cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to '...'

Saeedn823
Associate II

I'm working with stm32h743 MCU on a custom board by myself and stm32cubeide after i generate code without even adding a semicolon to code i build it i get undefined reference for many functions like FreeRTOS,Ethernet and etc and its better to know i configured same configuration for stm32f407vgt6 but everthing was ok also im using stm32cubide 1.16.1

1 ACCEPTED SOLUTION

Accepted Solutions

One issue is that the middleware directory is not set up as a source directory. You can do that here:

TDK_0-1727788218265.png

 

Doing that will still leave this error:

../Middlewares/Third_Party/LwIP/src/include/lwip/apps/httpd_opts.h:388:27: fatal error: fsdata.c: No such file or directory

Unclear how to solve that as fsdata.c is not a file that exist in the project as far as I can see.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5
Imen.D
ST Employee

Hello @Saeedn823 and welcome to the Community,

Make sure to set manually the Libraries and the Library Paths in your project settings.

Please have a look at this this post which may help you to add the Libraries.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Saeedn823
Associate II

I did it but still i have the same problem then i decided to configure my device step by step and after each one build my project it was ok and i hadn't have any issue till I configured LWIP that i got undefined reference for all object as well as FreeRTOS while before i add LWIP FreeRTOS functions was ok.

after all i found that the header files are ok and also CubeIDE only don't recognize C files under Middleware directory and other functions are ok even when i add new library under driver foldor.

You can access my project in attached file.

Thanks 

TDK
Guru

> after i generate code without even adding a semicolon to code i build it i get undefined reference

So this happens after you generate code without adding any new code? Include your IOC file.

Edit: Oh you already did. One sec...

If you feel a post has answered your question, please click "Accept as Solution".

One issue is that the middleware directory is not set up as a source directory. You can do that here:

TDK_0-1727788218265.png

 

Doing that will still leave this error:

../Middlewares/Third_Party/LwIP/src/include/lwip/apps/httpd_opts.h:388:27: fatal error: fsdata.c: No such file or directory

Unclear how to solve that as fsdata.c is not a file that exist in the project as far as I can see.

If you feel a post has answered your question, please click "Accept as Solution".

@TDK wrote:

One issue is that the middleware directory is not set up as a source directory.


 

@Saeedn823 If you look in the IDE's Project Explorer, the Source folders are the ones with the little 'C' emblem on them:

AndrewNeil_0-1727789119261.png

In this example, you can see that 'Core', 'Drivers' and 'cc1125-demo' are all Source folders, but 'Debug' is not.

The Compiler only looks for files  to compile in the Source folders - the Compiler ignores other folders.

 

When you create a new folder, the IDE gives you separate options for Source folders - distinct from other folders:

AndrewNeil_1-1727789351702.png

 

#SourceFolder