UNIX程序编译通过后没法执行(急)

ender1000 2009-03-11 08:37:51
dbx进去
Type 'help' for help.
reading symbolic information ...
(dbx) stop in main
[1] stop in main
(dbx) r

execution completed (exit code 99)
(dbx) where
glink64._exit() at 0x900000000071848
exit(??) at 0x90000000005e184
__C_runtime_startup() at 0x100000f30

直接退出,是不是环境没有设置好??
...全文
181 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
帮up
mosaic 2009-03-12
  • 打赏
  • 举报
回复
楼主的几个问题看起来都怪怪的,不知道是怎么操作才出来的
独孤过儿 2009-03-12
  • 打赏
  • 举报
回复
[shouweil][~]$ cat ctest.cpp
#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
cout << "hello, world!" << endl;
return 0;
}
[shouweil][~]$ CC -g -o ctest ctest.cpp
[shouweil][~]$ dbx -q ctest
(dbx) list
6 cout << "hello, world!" << endl;
7 return 0;
8 }
(dbx) stop at 6
(2) stop at "ctest.cpp":6
(dbx) run
Running: ctest
(process id 2860)
stopped in main at line 6 in file "ctest.cpp"
6 cout << "hello, world!" << endl;
(dbx) step
hello, world!
stopped in main at line 7 in file "ctest.cpp"
7 return 0;
(dbx) next
stopped in main at line 8 in file "ctest.cpp"
8 }
(dbx) quit
[shouweil][~]$

編譯和調試。樓主怎么編譯的?
ender1000 2009-03-12
  • 打赏
  • 举报
回复
#include <iostream>

using namespace std;

int main(int argc, char ** argv)
{
cout<<"hello world"<<endl;
return 0;
}

以前的代码编译都通了我新写的代码 居然 无法链接
ld: 0711-317 ERROR: Undefined symbol: .main
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

是不是库文件链接不上了
ender1000 2009-03-12
  • 打赏
  • 举报
回复
楼上还在
独孤过儿 2009-03-12
  • 打赏
  • 举报
回复
要是代碼不長,可以貼上來,我給你調一下看看
独孤过儿 2009-03-12
  • 打赏
  • 举报
回复

[shouweil][~]$ cat ctest.c
#include <stdio.h>

int main()
{
printf("Hello, world!\n");
return 0;
}

[shouweil][~]$ CC -g -o ctest ctest.c
[shouweil][~]$ dbx -q ctest
(dbx) list
5 printf("Hello, world!\n");
6 return 0;
7 }
(dbx) stop at 5
(2) stop at "ctest.c":5
(dbx) run
Running: ctest
(process id 11543)
stopped in main at line 5 in file "ctest.c"
5 printf("Hello, world!\n");
(dbx) step
Hello, world!
stopped in main at line 6 in file "ctest.c"
6 return 0;
(dbx) step
stopped in main at line 7 in file "ctest.c"
7 }
(dbx) step

execution completed, exit code is 0
(dbx)
kingsang 2009-03-12
  • 打赏
  • 举报
回复
换区问
ender1000 2009-03-12
  • 打赏
  • 举报
回复
楼上能否说详细点啊?
Faith2000 2009-03-12
  • 打赏
  • 举报
回复
library not found: -lx ﹖﹖﹖﹖
csgdseed 2009-03-12
  • 打赏
  • 举报
回复
换个区发
CuTe_CuBe 2009-03-12
  • 打赏
  • 举报
回复
牛B的人都不灌水
ender1000 2009-03-12
  • 打赏
  • 举报
回复
- -|||
ender1000 2009-03-12
  • 打赏
  • 举报
回复
早上牛逼人多些吧
独孤过儿 2009-03-12
  • 打赏
  • 举报
回复
呵呵,那原因就像我和你說的那樣了,是server編譯環境設置的問題,很可能是針對項目設置的!
ender1000 2009-03-12
  • 打赏
  • 举报
回复
gwnade01#[/billdb/bill/TIBS_HOME/src/app_test] xlC -g -q64 -o test test.cpp
gwnade01#[/billdb/bill/TIBS_HOME/src/app_test] dbx test
Type 'help' for help.
reading symbolic information ...
(dbx) stop in main
[1] stop in main
(dbx) r
[1] stopped in main at line 7 in file "test.cpp"
7 cout<<"hello world"<<endl;
(dbx) n
hello world
stopped in main at line 8 in file "test.cpp"
8 return 0;
(dbx) c

execution completed
(dbx)

这样是可以的哈
yttnh 2009-03-11
  • 打赏
  • 举报
回复
unix不懂,只是懂.net
胡须棉花糖 2009-03-11
  • 打赏
  • 举报
回复
不懂帮顶












SIGNATURE---------------------------------------------
I am Mr.Lonely
richard_2010 2009-03-11
  • 打赏
  • 举报
回复
就会简单的unix命令。。。
ender1000 2009-03-11
  • 打赏
  • 举报
回复
没有牛逼人嘛???
加载更多回复(2)

23,110

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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