[haiku-3rdparty-dev] g++ linking / project issue

  • From: Andrew Hudson <hudsonco1@xxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Wed, 12 Dec 2012 12:07:00 -0500 (EST)

This may be more of a general g++ linking or project question.


I am porting a BeOS multimedia app. It was last compiled probably with BEIDE in 
1999 or so. There was no proj or makefile to start with.  It has 200++ cpp 
files, in 7 folders,  which have all now compiled, with  warnings. It is 
written in an older version of C++ that had lax type checking.


Now I'm working on getting it linked. I'm using make, the compile line looks 
like this:
g++ -c TCueChannel.cpp -iquote/<Headers folder> -O0 -fpermissive -Wwrite-srings 
 -o "objects.x86-gcc4-release/TCueChannel.o"
and the link line looks like this:
gcc -o "objects.x86-gcc4-release/App" <long list of .o files> -L<local lib 
folder> -L/boot/develop/lib/x86/gcc4/lib -lbe -lroot -lmedia -ltranslation 
-ltracker -lstdc++ 


The current problem is that the link is not resolving certain 'new' operators. 
For instance there are multiple classes for dealing with cues: TMIDICue, 
TAudioCue, TTextCue, etc, called from TCueChannel.cpp. Linking gives this error:
TCueChannel.cpp:(.text+0x1ce4): undefined reference to 
'TMIDICue::TMIDICue(short, TCueChannel*, BRECT, unsigned long)'




TMIDICue.cpp, TAudioCue.cpp, and TTextCue.cpp are in the media folder. They are 
compiled with -fPIC and linked into a shared library, Media.so, which is copied 
into <local lib folder>. 


The TMIDICue new operator has the correct parameter list in TMIDICue.h. There 
is only one reference to the TMIDICue new operator, when I comment it out, the 
link error goes away. 


Any tips, advice, or pointers appreciated.


Thanks,
Andrew

Other related posts: