mingw libtool gcc不解析其他库中的引用
不是我的代码(AGAR GUI),但它在Linux中编译正常 现在我正试图在mingw64(Win)中构建它,在构建一个库(libag_gui.la)时,我遇到了这个错误: agCondEndRender存在于另一个名为ag_core的库中,该库包含一个文件 定义时间的.c(.o,.lo) 该图书馆的建设目的是:mingw libtool gcc不解析其他库中的引用,gcc,mingw,libtool,Gcc,Mingw,Libtool,不是我的代码(AGAR GUI),但它在Linux中编译正常 现在我正试图在mingw64(Win)中构建它,在构建一个库(libag_gui.la)时,我遇到了这个错误: agCondEndRender存在于另一个名为ag_core的库中,该库包含一个文件 定义时间的.c(.o,.lo) 该图书馆的建设目的是: ../mk/libtool/libtool --quiet --mode=link gcc -o **libag_core.la**
../mk/libtool/libtool --quiet --mode=link gcc -o **libag_core.la** -no-undefined -Wl,--no-undefined -XCClinker -static-libgcc -rpath /c/msys64/mingw64/lib -version-info 5:0:0
time_win32.lo time_posix.lo **time_renderer.lo** net.lo net_dummy.lo user_win32.lo variable.lo config.lo core.lo error.lo event.lo object.lo prop.lo timeout.lo class.lo cpuinfo.lo data_source.lo load_string.lo load_version.lo vsnprintf.lo vasprintf.lo asprintf.lo dir.lo md5.lo sha1.lo rmd160.lo file.lo string.lo dso.lo tree.lo time.lo time_dummy.lo db.lo tbl.lo getopt.lo exec.lo text.lo user.lo user_dummy.lo -lpthread -lwinmm
该库(ag_core)用于构建问题库,如下所示:
../mk/libtool/libtool --quiet --mode=link gcc -o **libag_gui.la** -no-undefined -Wl,--no-undefined -XCClinker -static-libgcc -rpath /c/msys64/mingw64/lib -version-info 5:0:0
drv_sdl2_common.lo **drv_sdl2.lo** drv_gl_common.lo drv_wgl.lo drv.lo drv_sw.lo drv_mw.lo gui.lo widget.lo window.lo iconmgr.lo geometry.lo colors.lo cursors.lo ttf.lo text.lo keymap.lo keymap_latin1.lo keymap_compose.lo keysyms.lo editable.lo box.lo label.lo button.lo checkbox.lo textbox.lo radio.lo fixed_plotter.lo tlist.lo scrollbar.lo spinbutton.lo titlebar.lo toolbar.lo fspinbutton.lo combo.lo ucombo.lo units.lo nlunits.lo hsvpal.lo mspinbutton.lo mfspinbutton.lo statusbar.lo menu.lo menu_view.lo treetbl.lo separator.lo notebook.lo pixmap.lo file_dlg.lo objsel.lo fixed.lo numerical.lo table.lo glview.lo mpane.lo pane.lo console.lo graph.lo socket.lo icon.lo progress_bar.lo slider.lo text_cache.lo load_surface.lo load_color.lo load_xcf.lo file_selector.lo scrollview.lo font_selector.lo time_sdl.lo debugger.lo surface.lo widget_legacy.lo global_keys.lo input_device.lo mouse.lo keyboard.lo packedpixel.lo load_bmp.lo load_jpg.lo load_png.lo dir_dlg.lo anim.lo stylesheet.lo **-L../core -lag_core** -L/mingw64/lib -lSDL2 -LC:/msys64/mingw64/lib -lfreetype -L/c/msys64/mingw64/lib -lopengl32 -lgdi32 -L/c/msys64/mingw64/lib -ljpeg -L/mingw64/lib -lpng16
-lm
(编辑:添加了lib ag_core的objdump)
我不确定这个输出意味着什么,但libag_core.a似乎不正确!为什么所有的值都是0x0…08
下面是time_renderer.c(似乎没有任何ifdef)的前几行
/*公共域*/
/*
*渲染感知时间后端。这对于执行
*脱机渲染,其中渲染结果可能受以下因素影响:
*不同的线程,每个线程使用AG_Delay()调用或Agar计时器。
*
*使用此后端,渲染周期的开始会导致AG_Delay()停止
*块,直到渲染周期完成。
*/
#包括
#包括
#包括
#包括
#包括
AG_Cond beginrender;
二次agCondEndRender;
AG_互斥agCondRenderLock;
静态结构timespect0;
关于我应该看的东西,有什么线索吗?它原来是libtool。除非你告诉它,否则它使用的是AGAR GUI。它包含在AGAR子文件夹mk/libtool中 将--with libtool=/usr/bin/libtool(使用其他libtool)添加到./configure命令行,如下所示:
./configure --host=x86_64-w64-mingw32 --prefix=$MINGWROOT --enable-debug --with-{freetype,sdl,png,jpeg,gl}=$MI
NGWROOT --with-libtool=/usr/bin/libtool --without-{fontconfig,sndfile,gettext,iconv}
您可能需要向mk/build.lib.mk添加--tag CC,如下所示:
LIBTOOLOPTS?= --tag CC --quiet
AGAR捆绑的libtool似乎有点旧了!检查agCondEndRender的libag_core.la(使用objdump)。功能也不是静态的(在某些
#ifdef
s下)$objdump-t libag_core.a | grep agCond[40](第0节)(fl 0x00)(ty 0)(scl 2)(nx 0)0x0000000000000008 agCondEndRender[41](第0节)(fl 0x00)(ty 0)(scl 2)(nx 0)0x0000000000000008 agCondEndRender[42](第0节)(fl 0x00)(ty 0)(scl 2)(nx 0)0x0000000000000008 AGCONDENDRENDERLOCK为什么所有值都是相同的0x08?
/* Public domain */
/*
* Rendering-aware time backend. This is useful for applications performing
* offline rendering, where the outcome of the rendering may be influenced by
* different threads, each using AG_Delay() calls or Agar timers.
*
* Using this backend, the start of a rendering cycle causes AG_Delay() to
* block until the rendering cycle is complete.
*/
#include <sys/types.h>
#include <time.h>
#include <string.h>
#include <unistd.h>
#include <agar/core/core.h>
AG_Cond agCondBeginRender;
AG_Cond agCondEndRender;
AG_Mutex agCondRenderLock;
static struct timespec t0;
./configure --host=x86_64-w64-mingw32 --prefix=$MINGWROOT --enable-debug --with-{freetype,sdl,png,jpeg,gl}=$MI
NGWROOT --with-libtool=/usr/bin/libtool --without-{fontconfig,sndfile,gettext,iconv}
LIBTOOLOPTS?= --tag CC --quiet