我正在尝试在Mac OS X Lion上构建omnet ++。
configure
工作正常,但是在创建tk共享库时我遇到了这个错误。
Creating shared library: /Applications/omnetpp-4.3/lib/cc_-arch_i386/libopptkenv.dylib
ld: warning: ld: warning: ignoring file /Applications/omnetpp-4.3/out/cc_-arch_i386-
release/src/tkenv/tkImgPNG.o, file was built for i386 which is not the architecture being
linked (x86_64): /Applications/omnetpp-4.3/out/cc_-arch_i386-
release/src/tkenv/tkImgPNG.oignoring file /Applications/omnetpp-4.3/out/cc_-arch_i386-
release/src/tkenv/tkImgPNGInit.o, file was built for i386 which is not the architecture
being linked (x86_64): /Applications/omnetpp-4.3/out/cc_-arch_i386-
release/src/tkenv/tkImgPNGInit.o
Undefined symbols for architecture x86_64:
"_Tkpng_Init", referenced from:
initTk(int, char**) in tklib.o
ld: symbol(s) not found for architecture x86_64
我修改了configure.user以使用64位架构。
CFLAGS_DEBUG='-g -Wall -arch x86_64'
CFLAGS_RELEASE='-O2 -DNDEBUG=1 -arch x86_64'
LDFLAGS="-arch x86_64"
然而,看起来omnet ++只使用32位架构。
make MODE=release
***** Configuration: MODE=release, TOOLCHAIN_NAME=cc_-arch_i386, LIB_SUFFIX=.dylib ****
如何将omnet ++构建为64位架构?
答案 0 :(得分:1)
我需要添加更多选项。
./configure CFLAG_ARCH='-arch x86_64'
make TOOLCHAIN_NAME=cc_-arch_x86_64