ChinaUnix.net
相关文章推荐:

gcc ld文件格式

最近在用gcc编译,之后ld连接时,发现生成的bin无法执行,狂搜了一阵。 现问题已经解决,简化阐述如下: 1 源文件hello.c #include int main(int argc, char *argv[]) { printf("hello\n"); return 0; } 2 gcc编译 gcc hello.c -o hello 然后运行 ./hello 输出结果 hello 3 gcc编译,ld连接 gcc -c hello.c -o hello.o ld -o hello hello.o 此时会出现问题,生成的hello文件无法执行...

by stavy - Linux文档专区 - 2008-06-19 18:26:02 阅读(1032) 回复(0)

相关讨论

http://blog.chinaunix.net/u1/33098/showart_260927.html 1.本文不是教程,只是描述c语言(gcc环境),编译器,连接器,加载器,at&t汇编,ia32一些相关知识和笔记,很多需要深入的地方需要大家寻找相关的资料学习。如果发现错误,请留言或通知我jinglexy at yahoo dot com dot cn,这个是我的msn。打字不易,请转载时保留作者。 2.gcc安装的各个部分: g++ c++编译器,链接时使用c++库 ...

by Reny - Linux文档专区 - 2008-11-21 10:07:38 阅读(1320) 回复(0)

原来 gcc: installation problem, cannot exec `as` No such file or directory #pkgadd -d SUNWsprot #pkgadd -d SUNWarc 之后,又出现了新的问题: bash-3.2# gcc test.c collect2: cannot find `ld' 请高手帮忙

by hardPass - Solaris - 2007-12-13 13:30:02 阅读(5426) 回复(6)

原来\r\ngcc: installation problem, cannot exec `as` No such file or directory\r\n\r\n\r\n#pkgadd -d SUNWsprot\r\n#pkgadd -d SUNWarc\r\n之后,又出现了新的问题:\r\n\r\nbash-3.2# gcc test.c\r\ncollect2: cannot find `ld\'\r\n\r\n请高手帮忙

by hardPass - Solaris - 2007-12-13 13:30:02 阅读(4877) 回复(4)

我写了一个Hello.c,在redhat as3上,结果ld过不去。 提示 /usr/local/bin/ld: unrecognized option '--eh-frame-hdr' /usr/local/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status 我查看/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs,链接部分这么写的: *link: %{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared} %{!shared: %{!ibcs: %{!static: %{rd...

by wanas - Linux环境编程 - 2007-01-18 18:36:17 阅读(2855) 回复(5)

我用的是从网上下的sco openserver5.07,在执行gcc命令时提示ld没有发现,请问我还要装什末软件呀?到哪里去下载呀! 我的gcc装的是VOL格式的. 谢谢!

by ccjsj1 - 其他UNIX - 2005-06-22 09:31:05 阅读(991) 回复(1)

在solaris用gcc编译.o文件成功,如下 /usr/local/bin/gcc -o CIcmp.o -c CIcmp.cpp -g -Wall -I /usr/include /usr/local/bin/gcc -o CNetDev.o -c CNetDev.cpp -g -Wall -I /usr/include /usr/local/bin/gcc -o CDevArr.o -c CDevArr.cpp -g -Wall -I /usr/include /usr/local/bin/gcc -o CIcmpTR.o -c CIcmpTR.cpp -g -Wall -I /usr/include /usr/local/bin/gcc -o main.o -c main.cpp -g -Wall -I /usr/include 继续...

by caoronghai - C/C++ - 2005-04-22 11:51:31 阅读(1493) 回复(1)

ld ld [options] objfiles Combine several objfiles, in the specified order, into a single executable object module (a.out by default). ld is the link editor and is often invoked automatically by compiler commands. ld accepts many options, the most common of which are listed here. Options -b format, --format=format If ld is configured to accept more than one kind of object file, this option can be ...

by anima - Linux文档专区 - 2006-08-13 00:40:49 阅读(512) 回复(0)

如题! 邮箱:[email=xuanmingyi@yeah.net]xuanmingyi@yeah.net[/email]

by vulturecc - Linux新手园地 - 2010-02-01 09:28:26 阅读(1097) 回复(3)

假设我这有个hello.c文件 $ gcc -c hello.c $ ls hello.c hello.o $ gcc hello.o $ ls a.out hello.o hello.c 但是我想让gcc hello.o这一步用ld来实现,也就是说我想知道gcc在连接时候连接了哪些文件 不知道我表达清不清楚,对了,我用的是centos 5.3

by 卢萨 - C/C++ - 2009-09-29 17:38:23 阅读(1139) 回复(4)

arm-linux-gcc -wall -O2 -c -o $@ $ 示例: Arm-linux-ld –Ttext 0x0000000 –g led.o –o led_elf 使用连接脚本设置地址: Arm-linux-ld –Ttimer.lds –o timer_elf $^ 其中timer.lds 为连接脚本 完整的连接脚本格式: SECTIONS{ … Secname start ALING(aling) (NOLOAD):AT(ldaddr) {contents} > region:phdr=fill ….. } arm-linux-objcopy被用来复制一个目标文件的内容到另一个文件中,可用于不同源文件的之间的格式转换 示...

by opennewlife - Linux文档专区 - 2009-09-25 21:17:29 阅读(1807) 回复(0)