cancel
Showing results for 
Search instead for 
Did you mean: 

Undefined referenece to error

ahmetgunduz
Associate III

Hi,

from Properties -> Paths and Symbols i added file path to 'Include Directories'. Then, i added my source file and my header file to 'my_libs' which i created under project_name -> Drivers.

When i call a function from library i see 'undefined reference to (function_name)' error.

How can i fix this?

Best regads.

1 ACCEPTED SOLUTION

Accepted Solutions

In this tree diagram the HAL_Driver node at the bottom?​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4

Include files describe the interfaces for the code, not the library code itself.

Add the library source files to your project so they get built, and are linkable.

For definitions, make sure stm32xyz_hal_conf.h in the project calls out the modules you want to use.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for answer.

I added this snippet to stm32f0xx_hal_conf.h

#ifdef DS18B20
#include "DS18B20.h"
#endif /* DS18B20 DRIVER ENABLED*/

But i couldn't understand where should i add the library source files0690X00000ArNc4QAF.png

In this tree diagram the HAL_Driver node at the bottom?​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks, now it works