Closed PASAf closed 6 years ago
allthough not the best solution you can pass -Wl,--allow-multiple-definition to LDFLAGS but be aware that if the thing your building is used to link to other stuff that this flag will propagate down to those as well so as said not the best solution. But try it and see if it runs.
@revelator Wow, sorry, I've not paid attention to this, since it was long time ago. Well, I was able to build app, but.. it crashes, and I didn't investigated problem furthermore.
That could indicate further problems down the chain. Cant say its the first time i came across a source that would not run when i had this form of linker error, but sometimes you get lucky.
Since there hasn't been any activity here for some time: Any news on this issue? Did you figure out the problem? Can this be closed?
@lazka Sorry, dunno if it solved from MINGW-packages side, I've used alot workarounds and tricks to get it to work, which I unnable to remember now. But yes, it is not more issue for me, so yeap, close it.
ok, thanks!
I'm aware this issue is from years ago now, but I ran into this same problem when compiling a fork of lxdream.
I eventually tracked this down to lxdream defining a FORCEINLINE
macro, which overrode the FORCEINLINE
macro defined in the mingw-w64 ntdef.h
header.
Changing lxdream's FORCEINLINE
macro to something else fixed the linking issues for me.
I have thousand of errors like
At the bottom I get
collect2.exe: error: ld returned 1 exit status
GCC run like this:
gcc -D__EXTENSIONS__ -D_BSD_SOURCE -D_GNU_SOURCE -mfpmath=sse -msse2 -g -fexceptions -fno-strict-aliasing -O2 -fomit-frame-pointer -std=c99 -o lxdream.exe lxdream-main.o lxdream-gtkui.o lxdream-gtk_win.o lxdream-gtkcb.o lxdream-gtk_cfg.o lxdream-gtk_mmio.o lxdream-gtk_debug.o lxdream-gtk_dump.o lxdream-gtk_ctrl.o lxdream-gtk_gd.o lxdream-video_gtk.o lxdream-video_wgl.o lxdream-audio_sdl.o lxdream-cd_none.o liblxdream-core.a -LR:/msys64/mingw32/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -LR:/msys64/mingw32/lib -lpng16 -LR:/msys64/mingw32/lib -lisofs -lm -lz -LR:/msys64/mingw32/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lopengl32 -lglu32 -lglew32 -lws2_32 -lmman -LR:/msys64/mingw32/lib -lmingw32 -lSDLmain -lSDL
No unresolved or undefined errors, just those multiple definitions.
What could cause such behaviour? How to deal with it?