
cygwin
vivianke
这个作者很懒,什么都没留下…
展开
-
VC 和 GCC(CYGWIN) 编译和链接简单使用
最近正在看《程序员的自我修养---链接、装载与库》,里面涉及了VC和GCC的编译和链接 (测试GCC的环境为CYGWIN,所有保证命令是一样,但是生成的文件名以及格式,会和实际的UNIX有所不同) 以下将两个环境下需要使用的命令,简单记录一下,希望对初学者有所提示: 1, VC VC自带的编译器cl.exe,当然使用cl命令的时候,X:\Program Files\Microsof原创 2011-11-20 10:22:03 · 1048 阅读 · 0 评论 -
cygwin中使用time查看程序执行时间
《Linux环境下C编程指南(第二版)》p58页介绍了time工具的使用。 如下所示: 说明如下: 其中real表示程序运行总耗时,user表示用于CPU运行的时间,sys表示处理系统调用所占用的时间。 附上示例代码: #include int main() { int counter; int ending; int temp; int five; for原创 2012-08-31 02:06:27 · 782 阅读 · 0 评论 -
cygwin中使用gprof分析程序性能
《Linux环境下C编程指南(第二版)》p63页介绍了其他的编译调试工具,其中提到了gprof。 参考链接: http://www.cnblogs.com/feisky/archive/2010/03/09/1681997.html 在编译程序时加上-pg选项,就可以在程序中使用pgrof,它在程序每次执行时产生一个叫gmon.out文件,gprof就使用这个文件来剖析信息。 程序原创 2012-08-31 02:19:28 · 818 阅读 · 0 评论 -
cygwin中使用calls
《Linux环境下C编程指南(第二版)》p63页介绍了其他的编译调试工具,其中提到了calls。 该工具的使用比较简单 calls test.c就可以显示该文件中的函数调用树图 示例如下: test.c #include #include #include /*;{}*/ void my_print(char *string); void my_print2(cha原创 2012-08-31 01:26:41 · 630 阅读 · 0 评论 -
Cygwin前后台切换
在Cygwin中使用jobs,可以查看当前处在后台中的任务,如图: 可以使用fg命令将后台的第一个任务前置。 例如在vim中使用Ctrl+Z,可以将当前的编辑任务转入后台,然后在需要的时候,使用fg将其前置。原创 2012-06-02 00:37:19 · 576 阅读 · 0 评论 -
附上Cygwin vim简单配置
" set for vim set nu "show number syntax on set autoindent "indent set ts=4 "tabstop = 4 set sw=4 "shiftwidth = 4 set showmatch set si set nocp "backup set "if has("vms") " set nobackup "do not keep原创 2012-04-22 16:53:20 · 433 阅读 · 0 评论 -
linux ll 命令
在.profile增加: alias l.='ls -d .* --color=tty' alias ll='ls -lh --color=tty' alias ls='ls --color=tty'原创 2011-10-12 19:50:00 · 531 阅读 · 0 评论 -
Cygwin下make的简单使用
摘要: 使用单条命令编译和链接 测试源码:test2.cpp,直接使用make命令即可编译和链接: $ make test2 g++ test2.cpp -o test2原创 2011-11-23 09:38:19 · 630 阅读 · 0 评论 -
GCC __attribute__((constructor和(destructor)) (Cygwin)
关注点:__attribute__机制,用于声明,而不是定义,并且其位置约束为放于声明的尾部“;”之前。 对于__attribute__((constructor和(destructor)) , 用法一: void before_main() __attribute__((constructor)); void before_main() { printf("befo原创 2011-11-23 09:30:19 · 485 阅读 · 0 评论 -
cygwin 下使用gcc创建和使用动态库
参考文章:http://www.linuxidc.com/Linux/2011-02/32453.htm 以及讨论帖:http://bbs.chinaunix.net/viewthread.php?tid=3555666 摘要: Cygwin下gcc只能使用.dll动态库,不能使用.so类型的动态库,所有在用gcc创建动态库的时候,-o的参数指定的动态库的名字需要为libxxx.dl原创 2011-11-20 21:10:46 · 1695 阅读 · 0 评论 -
cygwin gdb调试显示源码窗口
在cygwin中使用gdb调试的时候,可以通过如下方式显示源码。 使用示例: (gdb) b main Breakpoint 1 at 0x401191: file test4_4.c, line 4. (gdb) r Starting program: /home/Administrator/linux-study/book_linuxc/chapter4/a.exe [New th原创 2012-09-01 00:43:19 · 1269 阅读 · 0 评论