日期:2014-05-16  浏览次数:20554 次

gcc 参数求解
本人新手 、 各位不要见笑。
  makefile 配置文件 部分代码如下:
  
WPATH=/home/dev/cb

MYLIB=$(WPATH)/lib
BINPATH=$(WPATH)/bin

INCLUDE=$(WPATH)/include
SRCPATH=$(WPATH)/src

#FLAG= -O2 -Wall -AA
#FLAG= -O2 -Wall
FLAG=-g3 -fPIC -Wall -MD
#LDFLAG= -static -pthread /usr/lib/gcc/i386-redhat-linux/4.1.1/libstdc++.a
LDFLAG= -lstdc++ -pthread ---- 这里的两个参数不懂?

#CC=/usr/local/gcc-3.4.6/bin/g++
cc=/usr/bin/gcc

CFLAGS= $(CC) -c $(CFLAGS)

COMPLIE= $(CC) $(LDFLAG) ---- 这里用到 LDFLAG 我的理解是 这两个可能是 gcc 的参数 但是不理解
;LINK= $(CC) $(FLAG) -static





------解决方案--------------------
man gcc
-pthread
Add support for multithreading using the POSIX threads library.
This option sets flags for both the preprocessor and linker. It
does not affect the thread safety of object code produced by the
compiler or that of libraries supplied with it.

-lstdc++
链接c++库