undefined reference to `ceilf'

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

undefined reference to `ceilf'

ソリューションへジャンプ
1,187件の閲覧回数
Hrohn
Contributor II

When I compile the project with S32DS for S32 Platform, I need to use the "float ceilf(float)" function. I have included the header file math.h in my C file, but the ceilf function is still not defined, what can I do?

0 件の賞賛
返信
1 解決策
1,165件の閲覧回数
giraffe508
Contributor IV

Hi @Hrohn It seems like you are facing an issue with the linker not finding the reference to the `ceilf` function. To resolve this issue, you need to add the math library to your project's linker settings. Here's how you can do that:

  1. In S32 Design Studio, right-click on your project in the Project Explorer and select 'Properties.'
  2. Go to 'C/C++ Build' > 'Settings' > 'Cross ARM C++ Linker' > 'Libraries.'
  3. Click on the '+' button under 'Libraries (-l)' and add 'm' (without quotes) to the list. This will link the math library to your project.
  4. Click 'Apply' and then 'OK' to save the changes.
  5. Rebuild your project, and the linker should now find the reference to the `ceilf` function.

By following these steps, you should be able to resolve the undefined reference issue for the `ceilf` function in your S32DS project.
If you still face any issues, please provide more details about your project setup and configuration.

Regards, 

元の投稿で解決策を見る

2 返答(返信)
1,166件の閲覧回数
giraffe508
Contributor IV

Hi @Hrohn It seems like you are facing an issue with the linker not finding the reference to the `ceilf` function. To resolve this issue, you need to add the math library to your project's linker settings. Here's how you can do that:

  1. In S32 Design Studio, right-click on your project in the Project Explorer and select 'Properties.'
  2. Go to 'C/C++ Build' > 'Settings' > 'Cross ARM C++ Linker' > 'Libraries.'
  3. Click on the '+' button under 'Libraries (-l)' and add 'm' (without quotes) to the list. This will link the math library to your project.
  4. Click 'Apply' and then 'OK' to save the changes.
  5. Rebuild your project, and the linker should now find the reference to the `ceilf` function.

By following these steps, you should be able to resolve the undefined reference issue for the `ceilf` function in your S32DS project.
If you still face any issues, please provide more details about your project setup and configuration.

Regards, 

1,161件の閲覧回数
Hrohn
Contributor II

@giraffe508 Thanks for your reply. You helped me solve my problem.