我和GNU Autotools(特别是Libtool)的关系很麻烦,但由于它们在可移植性和交叉编译方面表现出色,所以我又开始使用它们了。
不幸的是,我无法让Libtool构建出正确的Windows DLL。但是,使用原始的make和gcc,可以轻松地为我构建DLL。
例如:
"Will haily build a DLL and import library. (Even without any annoying decelspec)."
"但是,如果我使用libtool这样做:"
Libtool 抱怨道:
“libSDL2main.a是一个静态库,没有DLL。有没有一种方法可以使用automake构建DLL而不使用libtool或告诉libtool停止大惊小怪?PS:在任何人提到它之前,我正在使用
不幸的是,我无法让Libtool构建出正确的Windows DLL。但是,使用原始的make和gcc,可以轻松地为我构建DLL。
例如:
LIBEXT = .dll
pkzo$(LIBEXT): $(patsubst %.cpp, %.o, $(pkzo_SOURCES)) resources.o
$(CXX) -shared -fPIC $(CXXFLAGS) $^ $(LDFLAGS) -Wl,--out-implib=libpkzo.lib -o $@
"Will haily build a DLL and import library. (Even without any annoying decelspec)."
"但是,如果我使用libtool这样做:"
lib_LTLIBRARIES = libpkzo.la
libpkzo_la_CXXFALGS = ...
libpkzo_la_LDADD = ...
libpkzo_la_SOURCES = ...
Libtool 抱怨道:
*** Warning: linker path does not have real file for library -lSDL2main.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libSDL2main and none of the candidates passed a file format test
*** using a file magic. Last file checked: /usr/local/lib/libSDL2main.a
*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
“libSDL2main.a是一个静态库,没有DLL。有没有一种方法可以使用automake构建DLL而不使用libtool或告诉libtool停止大惊小怪?PS:在任何人提到它之前,我正在使用
LT_INIT([shared static win32-dll])
配置libtool。”