Compiler/Linker can't locate my header files

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compiler/Linker can't locate my header files

938 Views
josephjean-jacq
Contributor III

Hi Everyone,

I been running into a strange issue for over a week now where the compiler isn't not compiling my header files. At first I thought it was a linker issue, now I believe it is a compiler issue. How do I know this? Because I would change some of the code so I could intentionally receive a C++ syntax error and instead I kept getting the same error stating the following: undefined reference to 'class name':: 'member function name'

Now, I went to File -> Properties -> Paths and Symbols  and quad triple checked in the 'Include Directories' list that all the paths for my header files were located there. 

I'm not sure why this is happening now because in the past I have included other header files that I knew were compiling for sure, because I would keep getting syntax errors until I made all the necessary code fixes to remove them.

I'm pretty sure there is an incredibly simple reason/solution to this, but I've been banging my head on this for over a week now.

Any pointers to guide me in the right direction would be definitely be appreciated!

3 Replies

806 Views
converse
Senior Contributor V

Without seeing your project, it is almost impossible to provide definitive answer. However 'Undefined reference' is a *linker* error, implying that either the module containing the definition is not being linked in, or there is something wrong with your declaration or invocation. Note that if a header file was not found by the compiler, you would receive a compilation error telling you that.

806 Views
josephjean-jacq
Contributor III

@Con Verse, thank you for the response. I just realized that I included the header files, but I did not include their source files. Is there a way to include source files besides dragging them manually into the project explorer window?

0 Kudos

806 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Joseph,

Make sure the folder where the source files are located is not excluded from build, the folder icon should be shown as in the image:

pastedImage_1.png

pastedImage_2.png
Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos