PDA

View Full Version : multiple definition error - NokiaQtSDK maemo



raedbenz
20th July 2010, 22:54
hello,
i am frustrated with this compiler error, plz have a look to my code attached (click here (http://www.mediafire.com/file/yykh11o31oohh90/test_multierror.rar))and enlighten me.
i am trying to use the Comms class inside the new.h so when i include comms.h in new.cpp i get erros.
everything is explained in the new.cpp file if u check the code.
Thanks in advance

Zlatomir
20th July 2010, 23:03
That usually happens when you define functions in an header file and include that header in multiple other files (you end-up with that functions having multiple definitions), if this is the case: move the definitions in a cpp file of that class

raedbenz
21st July 2010, 08:03
That usually happens when you define functions in an header file and include that header in multiple other files (you end-up with that functions having multiple definitions), if this is the case: move the definitions in a cpp file of that class

Thanks that worked...onemore hint, that i discovered, is that global variables should be defined in .cpp file and then define them as extern in a lets say, share.h header to use them all over the project.

cheerts