gcc编译问题请教。。。undefined reference to

chemmy2003 2007-11-10 07:06:40
一个system C(其实就是CPP的一个扩展)程序。编译

gcc -c没有问题 但是gcc -o 就不行了报错如下,谁给看看,谢谢。


/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function `_start':
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18): undefined reference to `main'
/tmp/ccZKFTjj.o: In function `sc_main':
/tmp/ccZKFTjj.o(.text+0x5b): undefined reference to `sc_module_name::sc_module_name(char const *)'
/tmp/ccZKFTjj.o(.text+0x8d): undefined reference to `sc_module_name::sc_module_name(char const *)'
/tmp/ccZKFTjj.o(.text+0xbf): undefined reference to `sc_module_name::sc_module_name(char const *)'
/tmp/ccZKFTjj.o(.text+0x15b): undefined reference to `sc_module::operator<<(sc_interface &)'
/tmp/ccZKFTjj.o(.text+0x166): undefined reference to `sc_module::operator<<(sc_interface &)'
/tmp/ccZKFTjj.o(.text+0x19c): undefined reference to `sc_module::operator<<(sc_interface &)'
/tmp/ccZKFTjj.o(.text+0x1a7): undefined reference to `sc_module::operator<<(sc_interface &)'
/tmp/ccZKFTjj.o(.text+0x1b2): undefined reference to `sc_module::operator<<(sc_interface &)'
/tmp/ccZKFTjj.o(.data+0x0): undefined reference to `sc_interface type_info node'
/tmp/ccZKFTjj.o: In function `sc_port_b<sc_signal_in_if<sc_dt::sc_bit> >::add_interface(sc_interface *)'


:。。。。。。。。。。。。。。。。。



/tmp/ccZKFTjj.o(.sc_pvector_base::gnu.linkonce.t.push_back(void *)+0x24): undefined reference to `sc_pvector_base::resize(int)'
collect2: ld returned 1 exit status
...全文
869 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
飞哥 2007-11-10
  • 打赏
  • 举报
回复
链接有错误
说明涉及到的函数没有实现部分,或者,被使用到了,但是没有在makefile中将其cpp编程.o
而且好像还没有main函数

64,649

社区成员

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

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