Skip to main content
ahmetgunduz
Associate III
Oct 28, 2019 9:29 PM UTC
Solved

Undefined referenece to error

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.

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Oct 29, 2019 9:01 AM UTC

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

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

4 replies

Tesla DeLorean
Guru
Oct 28, 2019 10:17 PM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
ahmetgunduz
Associate III
Oct 29, 2019 8:19 AM UTC

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

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Oct 29, 2019 9:01 AM UTC

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

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