Linux 笔试题目

bjsymbio 2010-09-03 10:27:09
what situation does key word volatile use in?
What's the role of "exec 2>/dev/null" in a shell script?
how to compile a linux dynamic library?
how to compile a linux static library?


When we compile a program, a dynamic library libmylib.so will be used and it is in /home/lib, while we running this program, a message shows "error while loading shared libraries: libmylib.so:can not open shared object file:No such file or directory". How to resolve it?

When we use command make foo for a C file named foo.c, make can work normally, but no makefile in that directory, why?


what's the function of CFLAGS in a makefile?

What's the function of command line ulimit -c unlimited??
...全文
407 21 打赏 收藏 转发到动态 举报
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
cd2108006026 2011-06-27
  • 打赏
  • 举报
回复
不对。是ulimit -c unlimited取消COREFILE大小
cd2108006026 2011-06-27
  • 打赏
  • 举报
回复
what situation does key word volatile use in?
多线程访问某个变量,且是单写多读的。

What's the role of "exec 2>/dev/null" in a shell script?
不显示错误输出

how to compile a linux dynamic library?
gcc -fPIC -shared libxxx.so a.c b.c ...

how to compile a linux static library?
ar -a libxxx.a a.o b.o c.o
ranlib libxxx

When we compile a program, a dynamic library libmylib.so will be used and it is in /home/lib, while we running this program, a message shows "error while loading shared libraries: libmylib.so:can not open shared object file:No such file or directory". How to resolve it?
修改LD_LIBRARY_PATH

When we use command make foo for a C file named foo.c, make can work normally, but no makefile in that directory, why?
......

what's the function of CFLAGS in a makefile?
编译选项


What's the function of command line ulimit -c unlimited??
取消各项限制
xuchaoding 2011-06-20
  • 打赏
  • 举报
回复
虽然不懂,不过支持了
wrj20080607 2011-06-20
  • 打赏
  • 举报
回复
呵呵,这个还有考试?
liuhex 2011-06-20
  • 打赏
  • 举报
回复
mark
hello_money 2011-06-20
  • 打赏
  • 举报
回复
不清楚,但还是要顶一下。
zaghost 2011-06-19
  • 打赏
  • 举报
回复
有了man google 百度 csdn 我就差不多能答个八九不离十 哈哈
nehc 2011-06-19
  • 打赏
  • 举报
回复
When we use command make foo for a C file named foo.c, make can work normally, but no makefile in that directory, why?


mark it !
delphiwcdj 2011-06-19
  • 打赏
  • 举报
回复
如果没有makefile,会提示Nothing to be done for XX.c,因为没有设置任何规则。
查了一下书,说 “makefile文件一般都会和项目的其他资源文件放在同一目录下”
我觉得题目的意思是不是在考察make的命令选项,因为题目比较基础。
make -f <filename> 告诉make命令将哪个文件作为makefile的文件,如果不指定,就像7L所言,make会有默认的寻找顺序。
如果上述不是,可能和make 的实现有关
delphiwcdj 2011-06-19
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 tananade 的回复:]
make 内置了很多命令规则(这大家都知道),如果你没有Makefile文件,你make命令加上目标文件名一样可以使用make命令, 比如这里是foo.c,可以直接make foo,而不需要有Makefile文件,除非内置命令达不到要求
[/Quote]
如果没有makefile,会提示Nothing to be done for XX.c,因为没有设置任何规则。
查了一下书,说“makefile文件一般都会和项目的其他资源文件放在同一目录下”
我觉得题目的意思是不是在考察make的命令选项,因为题目比较基础。
make -f <filename> 告诉make命令将哪个文件作为makefile的文件,如果不指定,就像7L所言,make会有默认的寻找顺序。
如果上述不是,可能和make的实现有关
wyjq395 2011-06-18
  • 打赏
  • 举报
回复
看起来很基础+我一个都不会 --> 对自己的无知感到恐惧症
bjsymbio 2011-06-18
  • 打赏
  • 举报
回复
.........大家继续啊!
tananade 2010-09-09
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 deep_pro 的回复:]

When we use command make foo for a C file named foo.c, make can work normally, but no makefile in that directory, why?
------
就这个还没听过,求解
[/Quote]

make 内置了很多命令规则(这大家都知道),如果你没有Makefile文件,你make命令加上目标文件名一样可以使用make命令, 比如这里是foo.c,可以直接make foo,而不需要有Makefile文件,除非内置命令达不到要求....
Xjbala 2010-09-07
  • 打赏
  • 举报
回复
还是英文的?
xiaocai0001 2010-09-07
  • 打赏
  • 举报
回复
When we compile a program, a dynamic library libmylib.so will be used and it is in /home/lib, while we running this program, a message shows "error while loading shared libraries: libmylib.so:can not open shared object file:No such file or directory". How to resolve it?
--------------------------------
export LD_LIBRARY_PATH=/home/lib, before run the program


When we use command make foo for a C file named foo.c, make can work normally, but no makefile in that directory, why?
--------------------
If no -f option is present, make will look for the makefiles GNUmakefile, makefile, and Makefile, in that order.
So 只需要有GNUmakefile或Makefile照样管用 (难道是脑筋急转弯这题?)



What's the function of command line ulimit -c unlimited??
---------------------------
ulimit: -c The maximum size of core files created
ulimit -c unlimited, 生成的Core file没有文件大小的限制

bjsymbio 2010-09-06
  • 打赏
  • 举报
回复
会就说说 大家分享看看答案好么? 大家都是苦命人啊
freetstar 2010-09-06
  • 打赏
  • 举报
回复
基本上都时比较基础的吧~我差不多能答个八九不离十
bjsymbio 2010-09-06
  • 打赏
  • 举报
回复
大家继续阿!!
笑遍世界 2010-09-04
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 deep_pro 的回复:]

When we use command make foo for a C file named foo.c, make can work normally, but no makefile in that directory, why?
------
就这个还没听过,求解
[/Quote]
莫非是这样?网上看到的..
make程序首先在当前目录查找名为makefile的文件,如果没有找到,它就会转而查找名为Makefile的文件。
Wenxy1 2010-09-04
  • 打赏
  • 举报
回复
比较基础的,稍带一点经验的题。
加载更多回复(1)

23,121

社区成员

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

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