随笔 - 28  文章 - 46  评论 - 20  阅读 - 81万
05 2012 档案
自己动手学编译器的链接和加载(一)
摘要:最近学习链接器的链接和装载过程。首先说说一个程序从源代码到可执行文件的流程(以linux平台上c程序为例):第一步预编译过程的命令如下:gcc -E test.c -o test.i 或 cpp test.c > test.i由.c文件生成.i预处理文件第二步:gcc -S test.i -o test.s由.i生成.s汇编文件第三步:as test.s -o test.o 或gcc -c test.s -o test.o生成目标文件第四步:ld -static /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc/i686-linux-gnu/4.6 阅读全文
posted @ 2012-05-19 16:33 渊蓝之蓝 阅读(700) 评论(0) 推荐(0) 编辑
关于seekg失效的问题
摘要:当file.eof()=1的时候seekg就不好用了,当file.eof()=0的时候seekg是好用的。也就是说当一个文件读到尾部以后,不能再用seekg来移动或者定位了。通过建立该文件新的对象能解决这个问题。如果只是输出的话可以用streambuf的rdbuf#include<fstream>#include<iostream>#include<string>using namespace std;int main(){ ofstream ofile("test.txt"); ofile<<"hello this 阅读全文
posted @ 2012-05-04 00:35 渊蓝之蓝 阅读(1392) 评论(1) 推荐(0) 编辑

< 2025年4月 >
30 31 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 1 2 3
4 5 6 7 8 9 10

点击右上角即可分享
微信分享提示