Skip to main content
ahmetgunduz
Associate III
October 28, 2019
Solved

Undefined referenece to error

  • October 28, 2019
  • 1 reply
  • 1222 views

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.
Best answer by Tesla DeLorean

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

1 reply

Tesla DeLorean
Guru
October 28, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
ahmetgunduz
Associate III
October 29, 2019

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
Guru
October 29, 2019

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

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