C++在solaris下的编译错误

zebiak123 2014-01-27 04:18:53
最近升级了系统的GCC和boost等第三方库,所以代码需要重新build一遍,之前的开发环境上build是没问题的,其他程序在新的环境上也没有问题,只有这个程序在build的过程中出了问题,希望大家给看一下是为什么
请看红色的提示,我不清楚这是因为少链接了库还是什么.
从蓝色的部分可以看出,这应该是构造和析构出了问题.
mkdir -p dist/Debug/GNU-Solaris-Sparc
g++ -pthreads -lsocket -lnsl -lposix4 -Wall -o dist/Debug/GNU-Solaris-Sparc/accagent build/Debug/GNU-Solaris-Sparc/AccDataTaker.o build/Debug/GNU-Solaris-Sparc/PassengerFlowThread.o build/Debug/GNU-Solaris-Sparc/Acc.o build/Debug/GNU-Solaris-Sparc/DeviceStatusThread.o build/Debug/GNU-Solaris-Sparc/EntityAccessFactory.o build/Debug/GNU-Solaris-Sparc/BasicSmith.o build/Debug/GNU-Solaris-Sparc/CBThread.o build/Debug/GNU-Solaris-Sparc/SegmentedDeviceStatus.o build/Debug/GNU-Solaris-Sparc/AccInfo.pb.o build/Debug/GNU-Solaris-Sparc/TimerThread.o -L../../../cots/poco_1_4_6/lib/SunOS/sun4v -L../../../cots/protobuf_2_4_1/src/.libs -L../../../cots/boost_1_55_0/stage/lib -L../../../tools/lib -L../../../cots/oracle/1120/solaris10_sparc/lib -L../../../sdk -L../../../cots/RCF_2_0_0_2670/library -lposix4 -lPocoFoundationd -lPocoNet -lPocoNetd -lPocoUtild -lboost_program_options -lboost_system -lboost_thread -lPocoFoundation -lPocoUtil -lclntsh -lprotobuf -lRCFLibrary -Wall
/u01/tabuild/DAS_TCC2/tools/gcc/lib/gcc/sparc-sun-solaris2.10/4.8.2/crt1.o: In function `.nope':
(.text+0x5c): undefined reference to `main'

build/Debug/GNU-Solaris-Sparc/AccDataTaker.o: In function `CAccDataTaker::~CAccDataTaker()':
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:18: undefined reference to `CPassengerFlowSmith::~CPassengerFlowSmith()'

/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:19: undefined reference to `CPassengerFlowSmith::~CPassengerFlowSmith()'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:20: undefined reference to `CStationModeSmith::~CStationModeSmith()'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:21: undefined reference to `CStationModeSmith::~CStationModeSmith()'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:22: undefined reference to `CDeviceStatusSmith::~CDeviceStatusSmith()'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:23: undefined reference to `CDeviceStatusSmith::~CDeviceStatusSmith()'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:24: undefined reference to `CCacheKeeper::~CCacheKeeper()'
build/Debug/GNU-Solaris-Sparc/AccDataTaker.o: In function `CAccDataTaker::Init()':
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:31: undefined reference to `CPassengerFlowSmith::CPassengerFlowSmith(std::string)'

/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:32: undefined reference to `CPassengerFlowSmith::CPassengerFlowSmith(std::string)'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:33: undefined reference to `CStationModeSmith::CStationModeSmith(std::string)'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:34: undefined reference to `CStationModeSmith::CStationModeSmith(std::string)'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:35: undefined reference to `CDeviceStatusSmith::CDeviceStatusSmith(std::string)'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:36: undefined reference to `CDeviceStatusSmith::CDeviceStatusSmith(std::string)'
/u01/tabuild/DAS_TCC2/code/app/AccAgent/AccDataTaker.cpp:37: undefined reference to `CCacheKeeper::CCacheKeeper()'
...全文
159 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
minchieh_fay 2014-01-30
  • 打赏
  • 举报
回复
在玩交叉编译? undefined reference这个不是常见错误么 有头文件 没有找到函数实现 即在合成二进制的时候,没有找到目标的.o文件 是不是你先编译掉,依赖的库呢?
sduxiaoxiang 2014-01-28
  • 打赏
  • 举报
回复
http://blog.csdn.net/aiwoziji13/article/details/7330333
赵4老师 2014-01-28
  • 打赏
  • 举报
回复
Windows下: 将错误信息中出现的标识符放在google里面搜一下,看其在哪个.lib中,然后在本地硬盘上搜索该.lib,如果没有,在网上搜索相关库或模块下载安装,然后将其所在目录填写到“附加依赖库所在目录”中,将其名字添加到“附加依赖库”中,重新连接。 solaris下可参考上面的思路
zebiak123 2014-01-27
  • 打赏
  • 举报
回复
make clean make是不行的。。
赵4老师 2014-01-27
  • 打赏
  • 举报
回复
make clean make
赵4老师 2014-01-27
  • 打赏
  • 举报
回复
盲目升级是码农之殇!

64,646

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧