Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 1:17 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Wed Oct 28, 2009 7:05 pm 
Offline

Joined: Wed Oct 28, 2009 6:40 pm
Posts: 4
Hi there,

I downloaded the 907 svn raydium version, compiled and installed it, then I started a new C++ project in NetBeans 6.5, linked on libraydium.so, coded the tutorials, compiled, and everything was right \o/

Now I got a problem coding c++. I'm not talking about ugly casts I have to do in order to stay C compliant :lol:

My problem is I got multiple definition compiler errors :

- multiple definition of `glutReshapeFuncCB'
- multiple definition of `glutKeyboardFuncCB'
- and so on more and more multiple definition errors...

I checked those points :
- I have no recursive looping includes
- I protected my own headers code files against multiple inclusions with ifndef def endif (classical)

Let me describe the hurting file hierarchy, don't worry it's very simple :

myProject.h includes index.h (the official raydium index.h)
main.cpp includes myProject.h
Toto.h includes myProject.h (yet because Toto owns a private GLfloat sun 8) )
Toto.cpp includes Toto.h

Of course I can include Gl/gl.h for GLfloat use instead of myProject.h but it will be annoying if I have to do this in all my future classes.

Oh, I although have found an interesting thing maybe related on the web :

http://learningcppisfun.blogspot.com/2009/01/inline-specializations-and-multiple.html

Does anyone have an idea ? I'm stucked.

JLys


Top
 Profile  
 
PostPosted: Wed Nov 04, 2009 9:16 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Hi,

- Redefinition errors appears for each compilation or only for some CPP files ? (main.cpp, toto.cpp, ...)
- Can you post the full redefinition error log, since with the "sample" you've provided, it seems that the trouble is limited to MyGLUT, that actually use a different linking schema than the other parts of the engine ... so the error may be on our side ;)


Top
 Profile  
 
PostPosted: Thu Nov 05, 2009 9:18 am 
Offline

Joined: Wed Oct 28, 2009 6:40 pm
Posts: 4
Hi,

I just compiled fine my cpp files individually. But at linkage with at least two object files, multiple definitions appear.

Here is the interesting part of the log, sorry for the eyehache :oops:

Code:
[...]
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/lambda/NetBeansProjects/lambdaProject/main.cpp:35: multiple definition of `glutReshapeFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:14: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/lambda/NetBeansProjects/lambdaProject/main.cpp:35: multiple definition of `glutKeyboardFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:14: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/lambda/NetBeansProjects/lambdaProject/main.cpp:39: multiple definition of `glutSpecialUpFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:14: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `_ov_header_fseek_wrap':
/usr/include/vorbis/vorbisfile.h:51: multiple definition of `glutSpecialFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:14: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `_ov_header_fseek_wrap':
/usr/include/vorbis/vorbisfile.h:51: multiple definition of `glutMotionFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:14: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `_ov_header_fseek_wrap':
/usr/include/vorbis/vorbisfile.h:52: multiple definition of `glutPassiveMotionFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:16: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `_ov_header_fseek_wrap':
/usr/include/vorbis/vorbisfile.h:52: multiple definition of `glutMouseFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:17: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `_ov_header_fseek_wrap':
/usr/include/vorbis/vorbisfile.h:53: multiple definition of `glutDisplayFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:17: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `_ov_header_fseek_wrap':
/usr/include/vorbis/vorbisfile.h:53: multiple definition of `glutIdleFuncCB'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:18: first defined here
build/Debug/GNU-Linux-x86/main.o: In function `_ov_header_fseek_wrap':
/usr/include/vorbis/vorbisfile.h:53: multiple definition of `raydium_profile_timer'
build/Debug/GNU-Linux-x86/_ext/home/lambda/NetBeansProjects/lambdaProject/Toto.o:/home/lambda/NetBeansProjects/lambdaProject/Toto.cpp:19: first defined here
[...]


Top
 Profile  
 
PostPosted: Thu Nov 05, 2009 9:11 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
I've updated the way MyGLUT is linked into the engine, it may fix your trouble. Can you try to update your svn copy and test again ? (patch is in rev911)

If st reads this post: can you confirm that this patch does not corrupt anything for your targets ? (I've only tested static/dynamic linking with Linux, and win32 SDK)


Top
 Profile  
 
PostPosted: Fri Nov 06, 2009 12:26 pm 
Offline

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Xfennec wrote:
If st reads this post: can you confirm that this patch does not corrupt anything for your targets ? (I've only tested static/dynamic linking with Linux, and win32 SDK)
Affirmative! I'm on revision 911. For all Apple targets the examples build and run like before. Good job! :D


Top
 Profile  
 
PostPosted: Fri Nov 06, 2009 5:05 pm 
Offline

Joined: Wed Oct 28, 2009 6:40 pm
Posts: 4
Hi,

It sounds great now, however stands an error since the constant raydium_profile_timer may be declared on a header file ?

Code:
/usr/include/vorbis/vorbisfile.h:51: multiple definition of `raydium_profile_timer'


I yearn to join the dev team :P

thank you,

JLys


Top
 Profile  
 
PostPosted: Fri Nov 06, 2009 11:13 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Oops. It seems I made the wrong fix for profile.c. I wish you the best of luck for rev 912 ;)

(Thanks for the tests, st)


Top
 Profile  
 
PostPosted: Sat Nov 07, 2009 12:45 pm 
Offline

Joined: Wed Oct 28, 2009 6:40 pm
Posts: 4
I just have a look at the code :

Code:
__rayapi unsigned long raydium_profile_timer;


As I intended I have found the global raydium_profile_timer in profile.h and that makes I still have errors.
I propose you to declare the global raydium_profile_timer in profile.c, and to declare it extern in other c files using it, avoiding multiple definition errors.


Top
 Profile  
 
PostPosted: Sat Nov 07, 2009 1:07 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
... My bad, really sorry, I made a mistake while fixing my previous mistake. Symbol declaration was moved to common.h, but was still declared in header profile.h were I forgot to delete it, as you reported.

This should be fixed in rev 913.


Top
 Profile  
 
PostPosted: Sun Nov 08, 2009 9:25 am 
Offline

Joined: Wed Oct 28, 2009 6:40 pm
Posts: 4
Lol, no problem, you react fast and raydium promit to be a marvel :D

Problem solved, thanks a lot !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group