LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 969|回复: 1

gcc中带的几个参数

[复制链接]
发表于 2006-3-2 20:27:43 | 显示全部楼层 |阅读模式
这里的libdemo-debug.a是一部分源码编译出来的静态库,demo-debug.o是用gcc加 -o从原文件demo.cpp(调用静态库的一个演示版)编译出来的“.o" 文件。这个静态库是向他人提供的接口(不想给源码)。不明白这里的参数:-pthread -rdynamic的作用。知道-pthread是使demo支持多线程。
  1. g++ -o demo-debug -g -pthread -rdynamic demo-debug.o libdemo-debug.a -ldl
复制代码
发表于 2006-3-3 09:18:12 | 显示全部楼层
man gcc:
       -pthread
           Adds support for multithreading with the pthreads library.  This
           option sets flags for both the preprocessor and linker.

-rdynamic 好像没有
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表