求助:config里各项的含义是什么呀?

这是wxWidgets论坛的中文版本。在这里,您可以用您的母语汉语讨论上面任一子论坛所涉及的所有关于wxWidgets的话题。欢迎大家参与到对有价值的帖子的中英互译工作中来!
Post Reply
cean
Earned a small fee
Earned a small fee
Posts: 11
Joined: Fri Nov 05, 2010 11:31 pm

求助:config里各项的含义是什么呀?

Post by cean »

我想编译dll的,变那项?


config.gcc在c:\wxWidgets-2.9.1\build\msw

部分内容如下:

# Compiler flags to link shared library
LINK_DLL_FLAGS ?= -shared

# Compiler flags to link loadable module
LINK_MODULE_FLAGS ?= -shared

# C compiler
CC = gcc

# C++ compiler
CXX = g++

# Standard flags for CC
CFLAGS ?=

# Standard flags for C++
CXXFLAGS ?=

# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=

# Standard linker flags
LDFLAGS ?=

# The C preprocessor
CPP ?= $(CC) -E

# What type of library to build? [0,1]
SHARED ?= 0

# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0
Equation gcc 4.5.1+wxWidgets 2.9.1+C::B 10.05 under win xp
cean
Earned a small fee
Earned a small fee
Posts: 11
Joined: Fri Nov 05, 2010 11:31 pm

Post by cean »


# What type of library to build? [0,1]
SHARED ?= 1

又编译了一遍,编译的时间比以前长多了。在c:\wxWidgets-2.9.1\build\msw里多了一个gcc_mswudll的目录,294m.

又编译了一下c:\wxWidgets-2.9.1\samples\minimal, 这
次在c:\wxWidgets-2.9.1\samples\minimal\gcc_mswudll里的minimal.exe只有4。2兆了,大小还行。可是运行时说找不到dll,要怎么设路径呀?
,
Equation gcc 4.5.1+wxWidgets 2.9.1+C::B 10.05 under win xp
xunxun1982
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Oct 14, 2010 12:20 pm

Post by xunxun1982 »

cean wrote:
# What type of library to build? [0,1]
SHARED ?= 1

又编译了一遍,编译的时间比以前长多了。在c:\wxWidgets-2.9.1\build\msw里多了一个gcc_mswudll的目录,294m.

又编译了一下c:\wxWidgets-2.9.1\samples\minimal, 这
次在c:\wxWidgets-2.9.1\samples\minimal\gcc_mswudll里的minimal.exe只有4。2兆了,大小还行。可是运行时说找不到dll,要怎么设路径呀?
,
strip后看看会小么
dll复制到程序所在目录 或者复制到windows\system32
cean
Earned a small fee
Earned a small fee
Posts: 11
Joined: Fri Nov 05, 2010 11:31 pm

Post by cean »

我把c:\wxWidgets-2.9.1\\lib\gcc_dll连到path里了,可以了。

strip? 怎么用? make -f -strip makefile.gcc?
Equation gcc 4.5.1+wxWidgets 2.9.1+C::B 10.05 under win xp
xunxun1982
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Oct 14, 2010 12:20 pm

Post by xunxun1982 »

cean wrote:我把c:\wxWidgets-2.9.1\\lib\gcc_dll连到path里了,可以了。

strip? 怎么用? make -f -strip makefile.gcc?
strip是binutils里的工具

进入c:\wxWidgets-2.9.1\\lib\gcc_dll目录

在命令行下使用 strip *.dll 所有的dll的debug符号会消除 同时会缩减体积

再进入你的exe程序的目录
strip *.exe
也会消除exe的debug符号 缩减体积
cean
Earned a small fee
Earned a small fee
Posts: 11
Joined: Fri Nov 05, 2010 11:31 pm

Post by cean »

比较神奇。原来minimal.exe 2M多,strip后只有500k了。

不过在dll目录里,dir *.dll可以。strip *.dll却不行,说没这个文件。可能不能用*通用吧。
Equation gcc 4.5.1+wxWidgets 2.9.1+C::B 10.05 under win xp
xunxun1982
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Oct 14, 2010 12:20 pm

Post by xunxun1982 »

cean wrote:比较神奇。原来minimal.exe 2M多,strip后只有500k了。

不过在dll目录里,dir *.dll可以。strip *.dll却不行,说没这个文件。可能不能用*通用吧。
正常情况下不会,strip支持通配符,但我见到过strip不支持通配符的情形,这可能是由于编译者在编译binutils时编译出现的问题,正确编译出来的strip会支持通配符的,如果不支持,你只能strip xxxxx.dll 一个一个用
Post Reply