总结之linux下的操作

来源:互联网 发布:河南数据统计采集门户 编辑:程序博客网 时间:2024/04/30 14:38

1.虚拟机下Ubuntu共享主机文件(Ubuntu、VMware、共享)

在ubuntu下访问windows的资源。

1)unbuntu上连接上网络

2)在windows上共享一个文件夹,然后在ubuntu上挂载。

http://blog.csdn.net/chencheng126/article/details/43938553


2.Linux mount Windows共享后编译出现“Value too large for defined data type”

搜了一下,通过mount来访问的windows共享目录下的C代码的时候,容易出现这个问题,后面加nounix,noserverino就搞定

mount //135.252.154.66/share /home/cc/examples -o username=chengic,password=****,dmask=777,fmask=777,nounix,noserverino
http://blog.csdn.net/chencheng126/article/details/43938925

3.Linux下的编译和调试

编译:
gcc -o test test.c
对于多线程,因为引用pthread.h,这是一个单独的类库,在编译的时候需要加上-lpthread
gcc -o pthread_cond2 pthread_cond2.c -lpthread

如果要用gdb调试,编译时需要加上-g参数:

gcc -g -Wall -o pthread_cond2 pthread_cond2.c -lpthread

调试工具GDB的参考文章:
http://blog.csdn.net/chencheng126/article/details/43950507

4.Linux静态链接库和动态链接库的区别,以及动态链接库的创建

1.介绍了静态链接库(*.a)和动态链接库(*.so).静态链接库是在编译的时候生成的,动态链接库是在运行(runtime)的时候生成的。动态的优势,可以实现进程间资源共享,程序升级变得简单,可以用code来控制链接载入。

2.介绍了动态链接库的创建方式,以及使用

最后给出了一个例子,清楚地说了编译和使用。

http://blog.csdn.net/chencheng126/article/details/43987111


5.去除^M的方法

http://blog.csdn.net/chencheng126/article/details/43951547





0 0
原创粉丝点击