Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linker warning: public symbol-

Status
Not open for further replies.

decripit

Programmer
Jan 16, 2002
3
US
I have a bit of a nagging problem. I've created a .cpp (myfuncs.cpp, no .h) file for my program. It contains several functions that are of use to different forms in the project.

myfuncs.cpp contains a global variable, 'String keywords'.

I #included the myfuncs.cpp in 2 different forms. When I compile the project it gives me a few linker warnings:
public symbol "_keywords" defined in both modual C:\...\form1.obj and C:\...\form2.obj
I know this problem spawns from my global variable, but I dont know what to do, because I have to have it and it's a waste to reinstate it with a different name in all 3 of the cpp's involved.
I know this is just a warning and is not really harmful, but I'd like to get it fixed. It's been an annoying little thorn in many of my projects and I don't know what to do to fix it. Does anyone else?
Decripit-
 
Perhaps you should create your global var in the main program ?
Have you tried to make it static ?
The Muppeteer.

themuppeteer@hotmail.com

Don't eat yellow snow...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top