Re: [info-performer] linux & C++ == hidden problem

New Message Reply Date view Thread view Subject view Author view

From: Allan Schaffer (allan++at++sgi.com)
Date: 01/06/2000 14:19:38


On Jan 6, 5:04pm, ross barna wrote:
> after wasting a few hours porting from IRIX to LINUX i found a bug that
> should be better advertised so that it doesn't eat up other programmers
> time!!!!

Indeed!

And so that anyone plugging the errors into an archive search can
more easily find this..

When compiling C++ based programs under Performer for Linux, you
MUST compile optimized or you'll see errors similar to the following:

[Compiling C++ perfly non-optimized]:

/usr/share/Performer/src/sample/C++/perfly/OPT.I386.OPENGL/../perfly.C:1732: undefined reference to `pfMPClipTexture::getClipTexture(void)'
configfile.o: In function `cmdline(_IO_FILE *, int)':
/usr/share/Performer/src/sample/C++/perfly/OPT.I386.OPENGL/../configfile.C:291: undefined reference to `pfGroup::addChild(pfNode *)'
configfile.o: In function `vehicleDCSAppFunc(pfTraverser *, void *)':
/usr/share/Performer/src/sample/C++/perfly/OPT.I386.OPENGL/../configfile.C:461: undefined reference to `pfDCS::setCoord(pfCoord *)'
configfile.o: In function `vehicle(_IO_FILE *, int)':
/usr/share/Performer/src/sample/C++/perfly/OPT.I386.OPENGL/../configfile.C:597: undefined reference to `pfGroup::addChild(pfNode *)'
/usr/share/Performer/src/sample/C++/perfly/OPT.I386.OPENGL/../configfile.C:598: undefined reference to `pfGroup::addChild(pfNode *)'
/usr/share/Performer/src/sample/C++/perfly/OPT.I386.OPENGL/../configfile.C:599: undefined reference to `pfGroup::addChild(pfNode *)'
main.o: In function `pfuProcessManager::getCur(void)':
/usr/include/Performer/pfutil/pfuProcessManager.h(.text+0x105): undefined reference to `pfChannel::getPWin(void)'
collect2: ld returned 1 exit status

As Ross quoted from the FAQ the solution is:

> C++-based programs linking with the IRIS Performer libraries must compile
> and link optimized. If the programs are not compiled optimized, the
> compiler will report "undefined reference" errors when linking
> the program. Note that with gcc you can compile with both -g and -O
> simultaneously. That will give you a debugged, optimized program that you
> can use with gdb to provide a stack trace or do your debugging.

Allan

-- 
Allan Schaffer                                            allan++at++sgi.com
Silicon Graphics                           http://reality.sgi.com/allan


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Jan 06 2000 - 15:36:53 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.