Skip to main content
gamedev.net
🔒 Locked

Linking problem

Started by dragon376 Apr 23, 2003 at 8:25 PM 11 replies 1.3k views
Original Post
dragon376
dragon376
I get the following error: symbol already defined in object The given symbol, displayed in its decorated form, was multiply defined. when I include this file more than once: http://www.kuenzle-family.ch/philippe/gl/init_ext.h in any program... I can still compile with the linker option /FORCE: MULTIPLE but I really need to find out why it does that... Thanks.
Sneftel
Sneftel
What symbol is multiply defined?

Also, don''t crosspost.


How appropriate. You fight like a cow.
Sneftel
Sneftel
Oh, duh me. The PROBLEM is that these are not extern definitions, so they get allocated space in every translation unit (cpp file).

Where did you get this file??


How appropriate. You fight like a cow.
Sneftel
Sneftel
Oh, and delete your crossposts.


How appropriate. You fight like a cow.
dragon376
dragon376
This file is a modified version of init file from nvidia. But the way they use it, it work fine. But in my program it screwed up.

Anyway, so, if I put an extern in front of them, I also need a cpp file with the actual variable that will be included only once... DUH ME TOO
I''ll change that.....

What is a crosspost?
Sneftel
Sneftel
A crosspost is when you post the same question in multiple forums. It makes us hate you. Delete all but one of them.


How appropriate. You fight like a cow.
dragon376
dragon376
K... I removed them.
Too bad it pisses people off because I got 3 people to answer my question instead of 1. I guess you would have seen it anyway since you found that I was crossposting... but still....
dragon376
dragon376
Here, I have modified the file. Created a CPP file with the function and put all the declaration in the .h file...
I still get the same error...
Any other idea?

http://www.kuenzle-family.ch/philippe/gl/glh_genext.cpp
http://www.kuenzle-family.ch/philippe/gl/glh_genext.h
Sneftel
Sneftel
You''re including the .h file, not the .cpp file, right?


How appropriate. You fight like a cow.
dragon376
dragon376
Well Wait...
I deleted all objects and recompiled everything...
Now I have a new set of error...
It doesn''t find some functions that I am declaring in glh_genext file...
I might be able to fix that...

I''ll let you know. Thanks for your help
dragon376
dragon376
It runs...
My latest error where from having different calling convention from the .h and the .cpp file...
Thanks again...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.