我在编译 wxWidget 应用程序时遇到了问题。我已经安装了最新版本的库,如下所示:
set arch_flags="-arch x86_64 "
./configure -with-osx_cocoa --disable-shared --disable-compat24 --enable-unicode --enable-universal-binary CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags"
sudo make install
我正在尝试编译一个简单的 hello-world 示例:
WXWIDGETS = -I/usr/local/include/wx-2.9/
CXXFLAGS = -O2 -g -Wall -Wextra -fmessage-length=0
CXX = $(shell wx-config --cxx)
PROGRAM = wxProjectExample
OBJECTS = $(PROGRAM).o
# implementation
.SUFFIXES: .o .cpp
.cpp.o :
$(CXX) -c `wx-config --static=yes --libs` `wx-config --static=yes --cxxflags` -o $@ $<
all: $(PROGRAM)
$(PROGRAM): $(OBJECTS)
$(CXX) -o $(PROGRAM) $(OBJECTS) `wx-config --libs`
clean:
rm -f *.o $(PROGRAM)
但是链接时编译失败:
ld: warning: in /System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture x86_64 in file
ld: warning: in /usr/lib/libwx_macud-2.8.dylib, missing required architecture x86_64 in file
Undefined symbols:
"wxWindowBase::DoSetVirtualSize(int, int)", referenced from:
vtable for MyFramein wxProjectExample.o
哪里可能有问题,或者有人对这个框架有类似的问题?
谢谢。
附言 系统:SnowLeopard(64 位)10.6.5。使用 intel proc,gcc 4.2。
最佳答案
我通过将新的 wx 二进制文件的路径添加到 PATH 来解决这个问题 $ export PATH=/usr/local/Cellar/wxmac/2.8.11/bin:$PATH
我正在使用 brew 安装 wxmac。
关于c++ - Snow Leopard 上的 wxWidgets 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4503260/