我正在使用播放器/舞台进行论文工作。但是,当我想在Eclipse CDT中构建此代码时,我收到未定义的引用错误消息
#include <iostream>
#include <playerc++.h>
#include <playerclient.h>
#include <clientproxy.h>
using namespace std;
int main()
{
PlayerClient robot("localhost",6665);
return 0;
}
错误消息是:
08:40:02 **** Build of configuration Debug for project firstTest ****
make all
Building file: ../src/firstTest.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/local/include/player-3.0/libplayerc++ -include/usr/local/include/player-3.0/libplayerc++/playerc++.h -include/usr/local/include/player-3.0/libplayerc++/clientproxy.h -include/usr/local/include/player-3.0/libplayerc++/playerc++config.h -include/usr/local/include/player-3.0/libplayerc++/playerclient.h -include/usr/local/include/player-3.0/libplayerc++/playererror.h -include/usr/local/include/player-3.0/libplayerc++/utility.h -O0 -g3 -Wall -c -fmessage-length=0 `pkg-config --cflags playerc++` -MMD -MP -MF"src/firstTest.d" -MT"src/firstTest.d" -o "src/firstTest.o" "../src/firstTest.cpp"
Finished building: ../src/firstTest.cpp
Building target: firstTest
Invoking: GCC C++ Linker
g++ `pkg-config --libs playerc++` -o "firstTest" ./src/firstTest.o
./src/firstTest.o: In function `main':
/home/nafees/workspace/firstTest/Debug/../src/firstTest.cpp:19: undefined reference to `PlayerCc::PlayerClient::PlayerClient(std::string, unsigned int, int)'
/home/nafees/workspace/firstTest/Debug/../src/firstTest.cpp:19: undefined reference to `PlayerCc::PlayerClient::~PlayerClient()'
collect2: error: ld returned 1 exit status
make: *** [firstTest] Error 1
08:40:02 Build Finished (took 514ms)
我已经按照Jenny-http://yorkroboticist.blogspot.com/2010/03/playerstage-on-eclipse.html发布的这个很好的教程了
在此链接中,您将获得我的Eclipse项目属性的快照:https://www.dropbox.com/sh/9hcmditufu0lt6v/AAChqD1-FMM9FhvTWpuOGMQ-a?dl=0
我已经尝试了很多方法来消除此错误。但是,一切都在静脉中。请帮我继续我的论文。
感谢Nafees
我已经找到了“未定义的引用”问题.....
如果有人想使用eclipse CDT进行舞台/播放器模拟,请按照以下步骤操作。我假设您已正确安装了播放器/舞台。
多数民众赞成.......现在尝试编译并构建一个示例代码。 :) :) :) :)