Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Header Issues[SOLVED]
Header Issues[SOLVED] [message #3187] Wed, 10 May 2006 20:49 Go to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
I believe I am having some issues with my header files. I just recently tried to create a second .cpp file with a different class and they both use the same header file. Please look over the error message below and the beginning of my header file.




Error Message:
2 file(s) compiled in (0:02.56) 1281 msec/file
Linking...
main.obj : error LNK2005: "public: static class Image const & __cdecl NCIcon::NCico(void)" (?NCico@NCIcon@@SAABVImage@@XZ) already defined in NCase_My
	SQL.obj
main.obj : error LNK2005: "public: static class Image const & __cdecl NCIcon::NCOK(void)" (?NCOK@NCIcon@@SAABVImage@@XZ) already defined in NCase_MySQ
	L.obj
main.obj : error LNK2005: "public: static class Image const & __cdecl NCIcon::n(void)" (?n@NCIcon@@SAABVImage@@XZ) already defined in NCase_MySQL.obj
C:\upp\out\MSC8.Gui.Mt\NCase.exe : fatal error LNK1169: one or more multiply defined symbols found

There were errors. (0:03.04)







Beggining of the header file

#ifndef _NCase_NCase_h_
#define _NCase_NCase_h_


//#include <NCase/NCase_expanded.h>
#include <NCase/define.h>
#include <NCase/prod_def.h>
#include <NCase/convert.h>

#include <CtrlLib/CtrlLib.h>
#include <MySql/MySql.h>

#define LAYOUTFILE <NCase/NCase.lay>
#include <CtrlCore/lay.h>

#define IMAGEFILE <NCase/NCase.iml>
#define IMAGECLASS NCIcon
#include <Draw/iml.h>




Any Ideas?



Justin

[Updated on: Thu, 11 May 2006 00:30]

Report message to a moderator

Re: Header Issues [message #3191 is a reply to message #3187] Wed, 10 May 2006 23:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Justin wrote on Wed, 10 May 2006 14:49

I believe I am having some issues with my header files. I just recently tried to create a second .cpp file with a different class and they both use the same header file. Please look over the error message below and the beginning of my header file.




Error Message:
2 file(s) compiled in (0:02.56) 1281 msec/file
Linking...
main.obj : error LNK2005: "public: static class Image const & __cdecl NCIcon::NCico(void)" (?NCico@NCIcon@@SAABVImage@@XZ) already defined in NCase_My
	SQL.obj
main.obj : error LNK2005: "public: static class Image const & __cdecl NCIcon::NCOK(void)" (?NCOK@NCIcon@@SAABVImage@@XZ) already defined in NCase_MySQ
	L.obj
main.obj : error LNK2005: "public: static class Image const & __cdecl NCIcon::n(void)" (?n@NCIcon@@SAABVImage@@XZ) already defined in NCase_MySQL.obj
C:\upp\out\MSC8.Gui.Mt\NCase.exe : fatal error LNK1169: one or more multiply defined symbols found

There were errors. (0:03.04)







Beggining of the header file

#ifndef _NCase_NCase_h_
#define _NCase_NCase_h_


//#include <NCase/NCase_expanded.h>
#include <NCase/define.h>
#include <NCase/prod_def.h>
#include <NCase/convert.h>

#include <CtrlLib/CtrlLib.h>
#include <MySql/MySql.h>

#define LAYOUTFILE <NCase/NCase.lay>
#include <CtrlCore/lay.h>

#define IMAGEFILE <NCase/NCase.iml>
#define IMAGECLASS NCIcon
#include <Draw/iml.h>



Yes. Use

#include <Draw/iml_header.h>

in header and

#include <Draw/iml_source.h>

in some .cpp.

#include <Draw/iml.h>

is just combination of both and works fine only as long as it is single file.

Mirek

Any Ideas?



Justin

Re: Header Issues [message #3192 is a reply to message #3191] Thu, 11 May 2006 00:30 Go to previous message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Perfect, you fixed my problem as usual.

Thank you Mirek (The life saver) Very Happy





Justin
Previous Topic: Switch with String type variables
Next Topic: How Use Substring Search?
Goto Forum:
  


Current Time: Thu Mar 28 18:19:50 CET 2024

Total time taken to generate the page: 0.01482 seconds