From: GuruPrasad M H. <pra...@ie...> - 2008-05-06 07:55:31
|
Hi all, I am compiling one of the player codes using * g++ -o example0 `pkg-config --cflags playerc++` example0.cc `pkg-config --libs playerc++` prasad@Vogue:~/my_programs/player_progs$ pkg-config --libs playerc++ -L/usr/local/lib -lplayerc++ -lplayerc -lm -lplayerxdr -lplayererror **prasad@Vogue:~/my_programs/player_progs$ pkg-config --libs playerc++ **-I/usr/local/include/player-2.1 * Now when i try to cross compile using arm based g++ compiler by using * prasad@Vogue:~/my_programs/player_progs$ ./my_g++ -c -I/usr/local/include/player-2.1/libplayerc++/ slow_turn.cc *i get no errors and i can find slow_turn.o in the current directory.* *But when i try to build the executable for the arm based processor using * * *prasad@Vogue:~/my_programs/player_progs$ ./my_g++ slow_turn.o -o slow_turn * here my_g++ is obtained by copying g++ cross compiler to the current directory and renaming it to my_g++.* And the listed errors are: * slow_turn.o: In function `main': slow_turn.cc:(.text+0x610): undefined reference to `PlayerCc::PlayerClient::PlayerClient(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, int)' slow_turn.cc:(.text+0x674): undefined reference to `PlayerCc::Position2dProxy::Position2dProxy(PlayerCc::PlayerClient*, unsigned int)' slow_turn.cc:(.text+0x718): undefined reference to `PlayerCc::PlayerClient::Read()' slow_turn.cc:(.text+0x7a8): undefined reference to `PlayerCc::Position2dProxy::~Position2dProxy()' slow_turn.cc:(.text+0x7d0): undefined reference to `PlayerCc::PlayerClient::~PlayerClient()' slow_turn.cc:(.text+0x864): undefined reference to `std::operator<<(std::basic_ostream<char, std::char_traits<char> >&, PlayerCc::PlayerError const&)' slow_turn.cc:(.text+0x888): undefined reference to `PlayerCc::PlayerError::~PlayerError()' slow_turn.cc:(.text+0x8a0): undefined reference to `PlayerCc::PlayerError::~PlayerError()' slow_turn.o: In function `PlayerCc::Position2dProxy::SetSpeed(double, double)': slow_turn.cc:(.text._ZN8PlayerCc15Position2dProxy8SetSpeedEdd[PlayerCc::Position2dProxy::SetSpeed(double, double)]+0x40): undefined reference to `PlayerCc::Position2dProxy::SetSpeed(double, double, double)' collect2: ld returned 1 exit status i also tried to compile using : *prasad@Vogue:~/my_programs/player_progs$ ./my_g++ slow_turn.o -o slow_turn -lm -lplayerc++ * i get the following errors: * /home/prasad/gumstix/gumstix-oe/tmp/cross/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -lplayerc++ collect2: ld returned 1 exit status* i know its a problem with the linking stage. Can anyone provide me with some fixes for this problem ? Thanks for the help and time. -- -Prasad |
From: bearclaw <bea...@fr...> - 2008-05-06 11:34:17
|
GuruPrasad M Hegde wrote: > > Hi all, > > I am compiling one of the player codes using > > * g++ -o example0 `pkg-config --cflags playerc++` example0.cc > `pkg-config --libs playerc++` > > prasad@Vogue:~/my_programs/player_progs$ pkg-config --libs playerc++ > -L/usr/local/lib -lplayerc++ -lplayerc -lm -lplayerxdr -lplayererror > > **prasad@Vogue:~/my_programs/player_progs$ pkg-config --libs playerc++ > **-I/usr/local/include/player-2.1 > * > Now when i try to cross compile using arm based g++ compiler by using > * > prasad@Vogue:~/my_programs/player_progs$ ./my_g++ -c > -I/usr/local/include/player-2.1/libplayerc++/ slow_turn.cc > *i get no errors and i can find slow_turn.o in the current directory.* > > *But when i try to build the executable for the arm based processor > using * > * > *prasad@Vogue:~/my_programs/player_progs$ ./my_g++ slow_turn.o -o > slow_turn > * > here my_g++ is obtained by copying g++ cross compiler to the current > directory and renaming it to my_g++.* > > And the listed errors are: > * slow_turn.o: In function `main': > slow_turn.cc:(.text+0x610): undefined reference to > `PlayerCc::PlayerClient: > :PlayerClient(std::basic_string<char, std::char_traits<char>, > std::allocator<char> >, unsigned int, int)' > slow_turn.cc:(.text+0x674): undefined reference to > `PlayerCc::Position2dProxy::Position2dProxy(PlayerCc::PlayerClient*, > unsigned int)' > slow_turn.cc:(.text+0x718): undefined reference to > `PlayerCc::PlayerClient::Read()' > slow_turn.cc:(.text+0x7a8): undefined reference to > `PlayerCc::Position2dProxy::~Position2dProxy()' > slow_turn.cc:(.text+0x7d0): undefined reference to > `PlayerCc::PlayerClient::~PlayerClient()' > slow_turn.cc:(.text+0x864): undefined reference to > `std::operator<<(std::basic_ostream<char, std::char_traits<char> >&, > PlayerCc::PlayerError const&)' > slow_turn.cc:(.text+0x888): undefined reference to > `PlayerCc::PlayerError::~PlayerError()' > slow_turn.cc:(.text+0x8a0): undefined reference to > `PlayerCc::PlayerError::~PlayerError()' > slow_turn.o: In function `PlayerCc::Position2dProxy::SetSpeed(double, > double)': > slow_turn.cc:(.text._ZN8PlayerCc15Position2dProxy8SetSpeedEdd[PlayerCc::Position2dProxy::SetSpeed(double, > double)]+0x40): undefined reference to > `PlayerCc::Position2dProxy::SetSpeed(double, double, double)' > collect2: ld returned 1 exit status > > i also tried to compile using : > *prasad@Vogue:~/my_programs/player_progs$ ./my_g++ slow_turn.o -o > slow_turn -lm -lplayerc++ > * > i get the following errors: > * > /home/prasad/gumstix/gumstix-oe/tmp/cross/lib/gcc/arm-angstrom-linux-gnueabi/4.1.2/../../../../arm-angstrom-linux-gnueabi/bin/ld: > cannot find -lplayerc++ > collect2: ld returned 1 exit status* > > i know its a problem with the linking stage. Can anyone provide me > with some fixes for this problem ? You need to also cross-compile the player libraries. With autotools this is easily done by doing ./configure --host=foo if your toolchain is prefixed by foo (foo-g++, foo-ld, foo-objdump, etc). WIth other build systems, just specify the compiler name by changing the appropriate variable. Also moving the cross-compiler after installing it might not be a good idea. > > > Thanks for the help and time. > > > > -- > -Prasad > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > ------------------------------------------------------------------------ > > _______________________________________________ > Playerstage-developers mailing list > Pla...@li... > https://lists.sourceforge.net/lists/listinfo/playerstage-developers > |