Welcome! Log In Create A New Profile

Advanced

New C File, undefined reference to....

Posted by Talantyyr 
New C File, undefined reference to....
May 31, 2010 10:26AM
Hi,

I'm currently working on addig SMB Support to Hugo GX ( [code.google.com] ).
SMB is already working, and i can load ROM's over SMB. But i want to store the Connection Data (IP / User / ..) in a xml File. So i've created a new file (preferences.h) and started to write some functions to do so :)

So far, everything compiles well, but when i use a function in one of the existing files. E.g. SavePrefs(), the linker tells me, that i'm using an undefined reference to SavePrefs(). When i use wrong parameters with this function, e.g. SavePrefs(thisisWrong) than i get a compiler error with "Wrong parameters in SavePrefs()". So it seems that the linker doesn't find the .o file?

This is the Makefile i'm using:
[code.google.com]
with additional -ltinysmb and -lmxml flags of course :)

Regarding to the makefile (SOURCES := source source/ngc source/ngc/gui source/ngc/fileio), it should be working.... My new .c (and .h as well) is located in /source Folder, like the other Files.

Please help me, i'm really stuck :- /



Edited 1 time(s). Last edit at 05/31/2010 10:27AM by Talantyyr.
Re: New C File, undefined reference to....
May 31, 2010 08:15PM
Make sure you have #include "saveprefslocation.h" wherever the prototype for SavePrefs() is located in the file using it.



Edited 2 time(s). Last edit at 06/02/2010 12:55AM by Arikado.
Re: New C File, undefined reference to....
June 01, 2010 09:52AM
Hi, i've included the correct .h but i found out, that the problem was, that i saved the file as .cpp instead of .c.... My Fault :)

Now it's linking.
Thx,
Chris
Sorry, only registered users may post in this forum.

Click here to login