From: YuGiOhJCJ Mailing-L. <yug...@la...> - 2012-09-15 11:41:58
|
Hello, I build a cross compiler for my GNU/Linux operating system to build Windows binaries. To do this I compiled binutils-2.21, gcc-4.6.0, mingwrt-3.15.2-mingw32 and w32api-3.13-mingw32 with the correct options. It works well in some cases: -compile goattracker -compile xmp -compile SDL -compile SDL_ttf -compile SDL_net -compile libiconv -compile zlib -compile freetype But in some other cases (SDL_mixer) I got a problem: $ export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig $ ./configure --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32 --disable-music-mod $ make /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o build/libSDL_mixer.la build/effect_position.lo build/effect_stereoreverse.lo build/effects_internal.lo build/load_aiff.lo build/load_voc.lo build/mixer.lo build/music.lo build/wavestream.lo build/common.lo build/ctrlmode.lo build/filter.lo build/instrum.lo build/mix.lo build/output.lo build/playmidi.lo build/readmidi.lo build/resample.lo build/sdl_a.lo build/sdl_c.lo build/tables.lo build/timidity.lo build/native_midi_common.lo build/native_midi_mac.lo build/native_midi_macosx.lo build/native_midi_win32.lo build/dynamic_mp3.lo build/version.o -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -L/usr/lib -lsmpeg -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 -version-info 12:0:12 *** Warning: Linking the shared library build/libSDL_mixer.la against the non-libtool *** objects build/version.o is not portable! libtool: link: i686-pc-mingw32-gcc -shared build/.libs/effect_position.o build/.libs/effect_stereoreverse.o build/.libs/effects_internal.o build/.libs/load_aiff.o build/.libs/load_voc.o build/.libs/mixer.o build/.libs/music.o build/.libs/wavestream.o build/.libs/common.o build/.libs/ctrlmode.o build/.libs/filter.o build/.libs/instrum.o build/.libs/mix.o build/.libs/output.o build/.libs/playmidi.o build/.libs/readmidi.o build/.libs/resample.o build/.libs/sdl_a.o build/.libs/sdl_c.o build/.libs/tables.o build/.libs/timidity.o build/.libs/native_midi_common.o build/.libs/native_midi_mac.o build/.libs/native_midi_macosx.o build/.libs/native_midi_win32.o build/.libs/dynamic_mp3.o build/version.o -L/usr/i686-pc-mingw32/lib -L/usr/lib /usr/lib/libsmpeg.so /usr/lib/libSDL.so -ldl -lvga -lpthread /usr/lib/libstdc++.so -lmingw32 /usr/i686-pc-mingw32/lib/libSDLmain.a /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm -mwindows -mwindows -pthread -o build/.libs/SDL_mixer.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker build/.libs/libSDL_mixer.dll.a i686-pc-mingw32-gcc: error: unrecognized option '-pthread' make: *** [build/libSDL_mixer.la] Error 1 I already encountered this problem while cross compiling other programs and it is boring because I need to edit each Makefile in order to replace "-pthread" by "-lpthread". But this time, "-pthread" isn't present in the Makefile... So no way to resolve like previously. How to have this "-pthread" option enabled on my cross compiler ? Why the configure script doesn't detect that it need use "-lpthread" instead of "-pthread" ? Thank you. Regards. -- YuGiOhJCJ <yug...@la...> http://yugiohjcj.1s.fr/ -- YuGiOhJCJ <yug...@la...> http://yugiohjcj.1s.fr/ |
From: Jeff R. <jro...@cs...> - 2012-09-15 15:19:01
|
Just to hazard a guess, it looks like libtool is injecting the -lpthreads. You can probably get around this by manually editing libSDL_mixer.la (a text file similar to *.pc files). I know close to nothing about libtool, but from what I hear it's similar to pkg-config. There's probably a dependency_libs variable in there that has the -pthread that you can change to -lpthread. On Sat, Sep 15, 2012 at 7:41 AM, YuGiOhJCJ Mailing-List <yug...@la...> wrote: > Hello, > > I build a cross compiler for my GNU/Linux operating system to build Windows binaries. > To do this I compiled binutils-2.21, gcc-4.6.0, mingwrt-3.15.2-mingw32 and w32api-3.13-mingw32 with the correct options. > It works well in some cases: > -compile goattracker > -compile xmp > -compile SDL > -compile SDL_ttf > -compile SDL_net > -compile libiconv > -compile zlib > -compile freetype > > But in some other cases (SDL_mixer) I got a problem: > $ export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig > $ ./configure --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32 --disable-music-mod > $ make > /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o build/libSDL_mixer.la build/effect_position.lo build/effect_stereoreverse.lo build/effects_internal.lo build/load_aiff.lo build/load_voc.lo build/mixer.lo build/music.lo build/wavestream.lo build/common.lo build/ctrlmode.lo build/filter.lo build/instrum.lo build/mix.lo build/output.lo build/playmidi.lo build/readmidi.lo build/resample.lo build/sdl_a.lo build/sdl_c.lo build/tables.lo build/timidity.lo build/native_midi_common.lo build/native_midi_mac.lo build/native_midi_macosx.lo build/native_midi_win32.lo build/dynamic_mp3.lo build/version.o -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -L/usr/lib -lsmpeg -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 -version-info 12:0:12 > > *** Warning: Linking the shared library build/libSDL_mixer.la against the non-libtool > *** objects build/version.o is not portable! > libtool: link: i686-pc-mingw32-gcc -shared build/.libs/effect_position.o build/.libs/effect_stereoreverse.o build/.libs/effects_internal.o build/.libs/load_aiff.o build/.libs/load_voc.o build/.libs/mixer.o build/.libs/music.o build/.libs/wavestream.o build/.libs/common.o build/.libs/ctrlmode.o build/.libs/filter.o build/.libs/instrum.o build/.libs/mix.o build/.libs/output.o build/.libs/playmidi.o build/.libs/readmidi.o build/.libs/resample.o build/.libs/sdl_a.o build/.libs/sdl_c.o build/.libs/tables.o build/.libs/timidity.o build/.libs/native_midi_common.o build/.libs/native_midi_mac.o build/.libs/native_midi_macosx.o build/.libs/native_midi_win32.o build/.libs/dynamic_mp3.o build/version.o -L/usr/i686-pc-mingw32/lib -L/usr/lib /usr/lib/libsmpeg.so /usr/lib/libSDL.so -ldl -lvga -lpthread /usr/lib/libstdc++.so -lmingw32 /usr/i686-pc-mingw32/lib/libSDLmain.a /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm -mwindows -mwindows -pthread -o build/.libs/SDL_mi! > xer.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker build/.libs/libSDL_mixer.dll.a > i686-pc-mingw32-gcc: error: unrecognized option '-pthread' > make: *** [build/libSDL_mixer.la] Error 1 > > I already encountered this problem while cross compiling other programs and it is boring because I need to edit each Makefile in order to replace "-pthread" by "-lpthread". > But this time, "-pthread" isn't present in the Makefile... So no way to resolve like previously. > > How to have this "-pthread" option enabled on my cross compiler ? > Why the configure script doesn't detect that it need use "-lpthread" instead of "-pthread" ? > > Thank you. > Regards. > > -- > YuGiOhJCJ <yug...@la...> > http://yugiohjcj.1s.fr/ > > -- > YuGiOhJCJ <yug...@la...> > http://yugiohjcj.1s.fr/ > > ------------------------------------------------------------------------------ > How fast is your code? > 3 out of 4 devs don\\\'t know how their code performs in production. > Find out how slow your code is with AppDynamics Lite. > http://ad.doubleclick.net/clk;262219672;13503038;z? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe |
From: Earnie B. <ea...@us...> - 2012-09-15 16:24:21
|
On Sat, Sep 15, 2012 at 11:18 AM, Jeff Rousseau wrote: Please do not top post. > Just to hazard a guess, it looks like libtool is injecting the > -lpthreads. You can probably get around this by manually editing > libSDL_mixer.la (a text file similar to *.pc files). I know close to > nothing about libtool, but from what I hear it's similar to > pkg-config. There's probably a dependency_libs variable in there that > has the -pthread that you can change to -lpthread. > The error has to do with version.o not being created by libtool commands. -- Earnie -- https://sites.google.com/site/earnieboyd |
From: Earnie B. <ea...@us...> - 2012-09-15 16:23:02
|
On Sat, Sep 15, 2012 at 7:41 AM, YuGiOhJCJ Mailing-List wrote: > Hello, > > I build a cross compiler for my GNU/Linux operating system to build Windows binaries. > To do this I compiled binutils-2.21, gcc-4.6.0, mingwrt-3.15.2-mingw32 and w32api-3.13-mingw32 with the correct options. > It works well in some cases: > -compile goattracker > -compile xmp > -compile SDL > -compile SDL_ttf > -compile SDL_net > -compile libiconv > -compile zlib > -compile freetype > > But in some other cases (SDL_mixer) I got a problem: > $ export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig > $ ./configure --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32 --disable-music-mod > $ make > /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o build/libSDL_mixer.la build/effect_position.lo build/effect_stereoreverse.lo build/effects_internal.lo build/load_aiff.lo build/load_voc.lo build/mixer.lo build/music.lo build/wavestream.lo build/common.lo build/ctrlmode.lo build/filter.lo build/instrum.lo build/mix.lo build/output.lo build/playmidi.lo build/readmidi.lo build/resample.lo build/sdl_a.lo build/sdl_c.lo build/tables.lo build/timidity.lo build/native_midi_common.lo build/native_midi_mac.lo build/native_midi_macosx.lo build/native_midi_win32.lo build/dynamic_mp3.lo build/version.o -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -L/usr/lib -lsmpeg -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 -version-info 12:0:12 > > *** Warning: Linking the shared library build/libSDL_mixer.la against the non-libtool > *** objects build/version.o is not portable! So what is being said is that build/version.o was not created under the control of libtool. You need to modify the makefile so that libtool is used to create build/version.o instead of GCC directly. -- Earnie -- https://sites.google.com/site/earnieboyd |
From: YuGiOhJCJ Mailing-L. <yug...@la...> - 2012-09-15 17:20:07
|
On Sat, 15 Sep 2012 12:22:55 -0400 Earnie Boyd <ea...@us...> wrote: > On Sat, Sep 15, 2012 at 7:41 AM, YuGiOhJCJ Mailing-List wrote: > > Hello, > > > > I build a cross compiler for my GNU/Linux operating system to build Windows binaries. > > To do this I compiled binutils-2.21, gcc-4.6.0, mingwrt-3.15.2-mingw32 and w32api-3.13-mingw32 with the correct options. > > It works well in some cases: > > -compile goattracker > > -compile xmp > > -compile SDL > > -compile SDL_ttf > > -compile SDL_net > > -compile libiconv > > -compile zlib > > -compile freetype > > > > But in some other cases (SDL_mixer) I got a problem: > > $ export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig > > $ ./configure --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32 --disable-music-mod > > $ make > > /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o build/libSDL_mixer.la build/effect_position.lo build/effect_stereoreverse.lo build/effects_internal.lo build/load_aiff.lo build/load_voc.lo build/mixer.lo build/music.lo build/wavestream.lo build/common.lo build/ctrlmode.lo build/filter.lo build/instrum.lo build/mix.lo build/output.lo build/playmidi.lo build/readmidi.lo build/resample.lo build/sdl_a.lo build/sdl_c.lo build/tables.lo build/timidity.lo build/native_midi_common.lo build/native_midi_mac.lo build/native_midi_macosx.lo build/native_midi_win32.lo build/dynamic_mp3.lo build/version.o -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -L/usr/lib -lsmpeg -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 -version-info 12:0:12 > > > > *** Warning: Linking the shared library build/libSDL_mixer.la against the non-libtool > > *** objects build/version.o is not portable! > > So what is being said is that build/version.o was not created under > the control of libtool. You need to modify the makefile so that > libtool is used to create build/version.o instead of GCC directly. > > -- > Earnie > -- https://sites.google.com/site/earnieboyd > > ------------------------------------------------------------------------------ > How fast is your code? > 3 out of 4 devs don\\\'t know how their code performs in production. > Find out how slow your code is with AppDynamics Lite. > http://ad.doubleclick.net/clk;262219672;13503038;z? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe OK I found the rule in the Makefile for building the "build/version.o" file: $(objects)/version.o: ./version.rc $(WINDRES) $< $@ Indeed, it uses i686-pc-mingw32-windres instead of libtool to build this file. So I replace $(WINDRES) by $(LIBTOOL): $(objects)/version.o: ./version.rc $(LIBTOOL) $< $@ I also try this: $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ But that's not a correct usage of libtool. Indeed, windres is for manipulate Windows resources whereas libtool is for building library. Can you explain me how to change this line correctly using libtool? Thank you. Regards. |
From: LRN <lr...@gm...> - 2012-09-16 01:16:52
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 15.09.2012 21:19, YuGiOhJCJ Mailing-List wrote: > On Sat, 15 Sep 2012 12:22:55 -0400 Earnie Boyd > <ea...@us...> wrote: > >> On Sat, Sep 15, 2012 at 7:41 AM, YuGiOhJCJ Mailing-List wrote: >>> Hello, >>> >>> I build a cross compiler for my GNU/Linux operating system to >>> build Windows binaries. To do this I compiled binutils-2.21, >>> gcc-4.6.0, mingwrt-3.15.2-mingw32 and w32api-3.13-mingw32 with >>> the correct options. It works well in some cases: -compile >>> goattracker -compile xmp -compile SDL -compile SDL_ttf -compile >>> SDL_net -compile libiconv -compile zlib -compile freetype >>> >>> But in some other cases (SDL_mixer) I got a problem: $ export >>> PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig $ >>> ./configure --prefix=/usr/i686-pc-mingw32 >>> --host=i686-pc-mingw32 --disable-music-mod $ make /bin/sh >>> ./libtool --mode=link i686-pc-mingw32-gcc -o >>> build/libSDL_mixer.la build/effect_position.lo >>> build/effect_stereoreverse.lo build/effects_internal.lo >>> build/load_aiff.lo build/load_voc.lo build/mixer.lo >>> build/music.lo build/wavestream.lo build/common.lo >>> build/ctrlmode.lo build/filter.lo build/instrum.lo build/mix.lo >>> build/output.lo build/playmidi.lo build/readmidi.lo >>> build/resample.lo build/sdl_a.lo build/sdl_c.lo build/tables.lo >>> build/timidity.lo build/native_midi_common.lo >>> build/native_midi_mac.lo build/native_midi_macosx.lo >>> build/native_midi_win32.lo build/dynamic_mp3.lo >>> build/version.o -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 >>> -lSDLmain -lSDL -lwinmm -L/usr/lib -lsmpeg -mwindows >>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm >>> -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 >>> -version-info 12:0:12 >>> >>> *** Warning: Linking the shared library build/libSDL_mixer.la >>> against the non-libtool *** objects build/version.o is not >>> portable! >> >> So what is being said is that build/version.o was not created >> under the control of libtool. You need to modify the makefile so >> that libtool is used to create build/version.o instead of GCC >> directly. >> > > > OK I found the rule in the Makefile for building the > "build/version.o" file: $(objects)/version.o: ./version.rc > $(WINDRES) $< $@ > > Indeed, it uses i686-pc-mingw32-windres instead of libtool to build > this file. So I replace $(WINDRES) by $(LIBTOOL): > $(objects)/version.o: ./version.rc $(LIBTOOL) $< $@ I also try > this: $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile > $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ > > But that's not a correct usage of libtool. Indeed, windres is for > manipulate Windows resources whereas libtool is for building > library. > > Can you explain me how to change this line correctly using > libtool? > $(LIBTOOL) --mode=compile $(WINDRES) with the right arguments -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBAgAGBQJQVSh1AAoJEOs4Jb6SI2CwHc4IALcr8lb1Tfv3dduoy418mozP AbUneTaUZCG0ocqk4GHOd4nn9Qfd0MkHhzHFep6RyHcvinW0CC3OfU5WLMLr4HY9 Ozw770UcGNwL5gILUVOj3KkEoOrKBvX8A2jgaawkx/XY8Hn5GclIbUOVsiYn8bV1 Y0wv9L8mJ48uyEQtW+eB2OSTmdC4YtFzYyhpKYdV3CIccMDvu7PjHP4R3AX+vvgM Q91J5/oKDagsvNYrI6TX8VJqF9AAcBZXiGHtx0cx2PKfcznnSBMW3AlYoqcKcACo a2d5DLEwdJHIvVq14/otAVMEl2V30Bighctqe0P3SJwNq9k+OHDx2EFIB6oYumw= =ZJfr -----END PGP SIGNATURE----- |
From: Roumen P. <bug...@ro...> - 2012-09-16 09:32:33
|
LRN wrote: > On 15.09.2012 21:19, YuGiOhJCJ Mailing-List wrote: >> [SNIP] >> >> OK I found the rule in the Makefile for building the >> "build/version.o" file: $(objects)/version.o: ./version.rc >> $(WINDRES) $< $@ >> >> Indeed, it uses i686-pc-mingw32-windres instead of libtool to build >> this file. So I replace $(WINDRES) by $(LIBTOOL): >> $(objects)/version.o: ./version.rc $(LIBTOOL) $< $@ I also try >> this: $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile >> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ >> >> But that's not a correct usage of libtool. Indeed, windres is for >> manipulate Windows resources whereas libtool is for building >> library. >> >> Can you explain me how to change this line correctly using >> libtool? >> > $(LIBTOOL) --mode=compile $(WINDRES) with the right arguments Just search for windres libtool and depending of use users should implement make rules .rc.lo: and .rc.o: . I guess that configure script initialize libtool with support for resource compiler. If automake is used you should list "am" flags for libtool and for resource compiler . Later mean to list AM_CPPFLAGS before CPPFLAGS and etc. Roumen |
From: farmdve data.b. <fa...@da...> - 2012-09-16 18:39:50
|
Sorry for the off-topic, but glad to see another Bulgarian :). On Sun, Sep 16, 2012 at 12:32 PM, Roumen Petrov <bug...@ro...> wrote: > LRN wrote: >> On 15.09.2012 21:19, YuGiOhJCJ Mailing-List wrote: >>> [SNIP] >>> >>> OK I found the rule in the Makefile for building the >>> "build/version.o" file: $(objects)/version.o: ./version.rc >>> $(WINDRES) $< $@ >>> >>> Indeed, it uses i686-pc-mingw32-windres instead of libtool to build >>> this file. So I replace $(WINDRES) by $(LIBTOOL): >>> $(objects)/version.o: ./version.rc $(LIBTOOL) $< $@ I also try >>> this: $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile >>> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ >>> >>> But that's not a correct usage of libtool. Indeed, windres is for >>> manipulate Windows resources whereas libtool is for building >>> library. >>> >>> Can you explain me how to change this line correctly using >>> libtool? >>> >> $(LIBTOOL) --mode=compile $(WINDRES) with the right arguments > > Just search for windres libtool and depending of use users should > implement make rules .rc.lo: and .rc.o: . > I guess that configure script initialize libtool with support for > resource compiler. If automake is used you should list "am" flags for > libtool and for resource compiler . Later mean to list AM_CPPFLAGS > before CPPFLAGS and etc. > > > Roumen > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://ad.doubleclick.net/clk;258768047;13503038;j? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe |
From: YuGiOhJCJ Mailing-L. <yug...@la...> - 2012-09-16 18:03:36
|
On Sun, 16 Sep 2012 05:16:38 +0400 LRN <lr...@gm...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 15.09.2012 21:19, YuGiOhJCJ Mailing-List wrote: > > On Sat, 15 Sep 2012 12:22:55 -0400 Earnie Boyd > > <ea...@us...> wrote: > > > >> On Sat, Sep 15, 2012 at 7:41 AM, YuGiOhJCJ Mailing-List wrote: > >>> Hello, > >>> > >>> I build a cross compiler for my GNU/Linux operating system to > >>> build Windows binaries. To do this I compiled binutils-2.21, > >>> gcc-4.6.0, mingwrt-3.15.2-mingw32 and w32api-3.13-mingw32 with > >>> the correct options. It works well in some cases: -compile > >>> goattracker -compile xmp -compile SDL -compile SDL_ttf -compile > >>> SDL_net -compile libiconv -compile zlib -compile freetype > >>> > >>> But in some other cases (SDL_mixer) I got a problem: $ export > >>> PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig $ > >>> ./configure --prefix=/usr/i686-pc-mingw32 > >>> --host=i686-pc-mingw32 --disable-music-mod $ make /bin/sh > >>> ./libtool --mode=link i686-pc-mingw32-gcc -o > >>> build/libSDL_mixer.la build/effect_position.lo > >>> build/effect_stereoreverse.lo build/effects_internal.lo > >>> build/load_aiff.lo build/load_voc.lo build/mixer.lo > >>> build/music.lo build/wavestream.lo build/common.lo > >>> build/ctrlmode.lo build/filter.lo build/instrum.lo build/mix.lo > >>> build/output.lo build/playmidi.lo build/readmidi.lo > >>> build/resample.lo build/sdl_a.lo build/sdl_c.lo build/tables.lo > >>> build/timidity.lo build/native_midi_common.lo > >>> build/native_midi_mac.lo build/native_midi_macosx.lo > >>> build/native_midi_win32.lo build/dynamic_mp3.lo > >>> build/version.o -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 > >>> -lSDLmain -lSDL -lwinmm -L/usr/lib -lsmpeg -mwindows > >>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm > >>> -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 > >>> -version-info 12:0:12 > >>> > >>> *** Warning: Linking the shared library build/libSDL_mixer.la > >>> against the non-libtool *** objects build/version.o is not > >>> portable! > >> > >> So what is being said is that build/version.o was not created > >> under the control of libtool. You need to modify the makefile so > >> that libtool is used to create build/version.o instead of GCC > >> directly. > >> > > > > > > OK I found the rule in the Makefile for building the > > "build/version.o" file: $(objects)/version.o: ./version.rc > > $(WINDRES) $< $@ > > > > Indeed, it uses i686-pc-mingw32-windres instead of libtool to build > > this file. So I replace $(WINDRES) by $(LIBTOOL): > > $(objects)/version.o: ./version.rc $(LIBTOOL) $< $@ I also try > > this: $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile > > $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ > > > > But that's not a correct usage of libtool. Indeed, windres is for > > manipulate Windows resources whereas libtool is for building > > library. > > > > Can you explain me how to change this line correctly using > > libtool? > > > $(LIBTOOL) --mode=compile $(WINDRES) with the right arguments > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (MingW32) > Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ > > iQEcBAEBAgAGBQJQVSh1AAoJEOs4Jb6SI2CwHc4IALcr8lb1Tfv3dduoy418mozP > AbUneTaUZCG0ocqk4GHOd4nn9Qfd0MkHhzHFep6RyHcvinW0CC3OfU5WLMLr4HY9 > Ozw770UcGNwL5gILUVOj3KkEoOrKBvX8A2jgaawkx/XY8Hn5GclIbUOVsiYn8bV1 > Y0wv9L8mJ48uyEQtW+eB2OSTmdC4YtFzYyhpKYdV3CIccMDvu7PjHP4R3AX+vvgM > Q91J5/oKDagsvNYrI6TX8VJqF9AAcBZXiGHtx0cx2PKfcznnSBMW3AlYoqcKcACo > a2d5DLEwdJHIvVq14/otAVMEl2V30Bighctqe0P3SJwNq9k+OHDx2EFIB6oYumw= > =ZJfr > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://ad.doubleclick.net/clk;258768047;13503038;j? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > Also: mailto:min...@li...?subject=unsubscribe So you said I should use: $(LIBTOOL) --mode=compile $(WINDRES) with the right arguments... The problem is what are the right arguments? I never used libtool and windres. I read the libtool manual and "--mode" is an option of libtool. This option can indeed, take the "compile" value. After this, I must put the compile-command... Do you think $(WINDRES) is a compile-command? And at the end I need to put the sourcefile. Is it the .rc file? This is the synopsis: libtool [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE I started with this try (no arguments): $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile $(WINDRES) Then I tested with this (2 arguments): $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile $(WINDRES) $< $@ Finally, I try this: $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile $(WINDRES) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ But in the 3 cases, it is a bad usage of the libtool and windres commands. Can you explain me how to patch the Makefile in order to be able to build the 'build/version.o' file for my cross compile? Thank you. Regards. |
From: LRN <lr...@gm...> - 2012-09-17 01:33:11
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 16.09.2012 22:03, YuGiOhJCJ Mailing-List wrote: > On Sun, 16 Sep 2012 05:16:38 +0400 LRN wrote: >> On 15.09.2012 21:19, YuGiOhJCJ Mailing-List wrote: >>> On Sat, 15 Sep 2012 12:22:55 -0400 Earnie Boyd wrote: >>>> On Sat, Sep 15, 2012 at 7:41 AM, YuGiOhJCJ Mailing-List >>>> wrote: >>>>> Hello, >>>>> >>>>> I build a cross compiler for my GNU/Linux operating system >>>>> to build Windows binaries. To do this I compiled >>>>> binutils-2.21, gcc-4.6.0, mingwrt-3.15.2-mingw32 and >>>>> w32api-3.13-mingw32 with the correct options. It works well >>>>> in some cases: -compile goattracker -compile xmp -compile >>>>> SDL -compile SDL_ttf -compile SDL_net -compile libiconv >>>>> -compile zlib -compile freetype >>>>> >>>>> But in some other cases (SDL_mixer) I got a problem: $ >>>>> export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig >>>>> $ ./configure --prefix=/usr/i686-pc-mingw32 >>>>> --host=i686-pc-mingw32 --disable-music-mod $ make /bin/sh >>>>> ./libtool --mode=link i686-pc-mingw32-gcc -o >>>>> build/libSDL_mixer.la build/effect_position.lo >>>>> build/effect_stereoreverse.lo build/effects_internal.lo >>>>> build/load_aiff.lo build/load_voc.lo build/mixer.lo >>>>> build/music.lo build/wavestream.lo build/common.lo >>>>> build/ctrlmode.lo build/filter.lo build/instrum.lo >>>>> build/mix.lo build/output.lo build/playmidi.lo >>>>> build/readmidi.lo build/resample.lo build/sdl_a.lo >>>>> build/sdl_c.lo build/tables.lo build/timidity.lo >>>>> build/native_midi_common.lo build/native_midi_mac.lo >>>>> build/native_midi_macosx.lo build/native_midi_win32.lo >>>>> build/dynamic_mp3.lo build/version.o -mwindows >>>>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL >>>>> -lwinmm -L/usr/lib -lsmpeg -mwindows >>>>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm >>>>> -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 >>>>> -version-info 12:0:12 >>>>> >>>>> *** Warning: Linking the shared library >>>>> build/libSDL_mixer.la against the non-libtool *** objects >>>>> build/version.o is not portable! >>>> >>>> So what is being said is that build/version.o was not >>>> created under the control of libtool. You need to modify the >>>> makefile so that libtool is used to create build/version.o >>>> instead of GCC directly. >>>> >>>> >>>> >>> OK I found the rule in the Makefile for building the >>> "build/version.o" file: $(objects)/version.o: ./version.rc >>> $(WINDRES) $< $@ >>> >>> Indeed, it uses i686-pc-mingw32-windres instead of libtool to >>> build this file. So I replace $(WINDRES) by $(LIBTOOL): >>> $(objects)/version.o: ./version.rc $(LIBTOOL) $< $@ I also try >>> this: $(objects)/version.o: ./version.rc $(LIBTOOL) >>> --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c >>> $< -o $@ >>> >>> But that's not a correct usage of libtool. Indeed, windres is >>> for manipulate Windows resources whereas libtool is for >>> building library. >>> >>> Can you explain me how to change this line correctly using >>> libtool? >>> >> $(LIBTOOL) --mode=compile $(WINDRES) with the right arguments >> > > > So you said I should use: $(LIBTOOL) --mode=compile $(WINDRES) with > the right arguments... The problem is what are the right > arguments? I never used libtool and windres. I read the libtool > manual and "--mode" is an option of libtool. This option can > indeed, take the "compile" value. After this, I must put the > compile-command... Do you think $(WINDRES) is a compile-command? > And at the end I need to put the sourcefile. Is it the .rc file? > This is the synopsis: libtool [OPTION]... --mode=compile > COMPILE-COMMAND... SOURCEFILE > > > I started with this try (no arguments): $(objects)/version.o: > ./version.rc $(LIBTOOL) --mode=compile $(WINDRES) Then I tested > with this (2 arguments): $(objects)/version.o: ./version.rc > $(LIBTOOL) --mode=compile $(WINDRES) $< $@ Finally, I try this: > $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile > $(WINDRES) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ > > But in the 3 cases, it is a bad usage of the libtool and windres > commands. > > Can you explain me how to patch the Makefile in order to be able to > build the 'build/version.o' file for my cross compile? > > Thank you. Regards. Please, delete people's e-mail addresses from your reply (or rather, tell your e-mail client to do so), and also trim message footers when replying. As for compiling, here's a part of libgcrypt Makefile.am: RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(libgcrypt_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RCCOMPILE) SUFFIXES = .rc .lo .rc.lo: $(LTRCCOMPILE) -i "$<" -o "$@" That's how it looks in Makefile: RC = windres DEFS = -DHAVE_CONFIG_H DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) CPPFLAGS = LIBTOOL = $(SHELL) $(top_builddir)/libtool RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(libgcrypt_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RCCOMPILE) SUFFIXES = .rc .lo -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBAgAGBQJQVn3LAAoJEOs4Jb6SI2CwmSsIAMbMZEJ/K8Lat437AeNTwiyD I9N1TFXqfvJCB8Zfb9N2hx6oOM9xnIy8QK0q6ZBzHoezaMFyrMr6v73usR/pQjLc DyBEvsTnPbEzUKbgollV+tCDBULaiz6B85FW6TQSTwsiTHASVMIKnUS2v03fVCAM G2QDKYSz+LLnI7/JzhqwN0dqUbTlD4BeFjOiKH17kCkfWcB2bCsv5J/25RbENC8r c6MuITZK1PbNZfJkUmFJw9kBKMgbOxtbGgXlfPnhBD/jCfLC+fKw/xSmhXy+349Y T8SyyoQtmZDs6sriV+7pQOsyw9NsG5+nZ2TnINlmeyb+JwSz5Lpz5wx3eBp2Ow8= =R6uW -----END PGP SIGNATURE----- |
From: YuGiOhJCJ Mailing-L. <yug...@la...> - 2012-09-17 19:31:46
|
On Mon, 17 Sep 2012 05:33:00 +0400 LRN <lr...@gm...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 16.09.2012 22:03, YuGiOhJCJ Mailing-List wrote: > > On Sun, 16 Sep 2012 05:16:38 +0400 LRN wrote: > >> On 15.09.2012 21:19, YuGiOhJCJ Mailing-List wrote: > >>> On Sat, 15 Sep 2012 12:22:55 -0400 Earnie Boyd wrote: > >>>> On Sat, Sep 15, 2012 at 7:41 AM, YuGiOhJCJ Mailing-List > >>>> wrote: > >>>>> Hello, > >>>>> > >>>>> I build a cross compiler for my GNU/Linux operating system > >>>>> to build Windows binaries. To do this I compiled > >>>>> binutils-2.21, gcc-4.6.0, mingwrt-3.15.2-mingw32 and > >>>>> w32api-3.13-mingw32 with the correct options. It works well > >>>>> in some cases: -compile goattracker -compile xmp -compile > >>>>> SDL -compile SDL_ttf -compile SDL_net -compile libiconv > >>>>> -compile zlib -compile freetype > >>>>> > >>>>> But in some other cases (SDL_mixer) I got a problem: $ > >>>>> export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig > >>>>> $ ./configure --prefix=/usr/i686-pc-mingw32 > >>>>> --host=i686-pc-mingw32 --disable-music-mod $ make /bin/sh > >>>>> ./libtool --mode=link i686-pc-mingw32-gcc -o > >>>>> build/libSDL_mixer.la build/effect_position.lo > >>>>> build/effect_stereoreverse.lo build/effects_internal.lo > >>>>> build/load_aiff.lo build/load_voc.lo build/mixer.lo > >>>>> build/music.lo build/wavestream.lo build/common.lo > >>>>> build/ctrlmode.lo build/filter.lo build/instrum.lo > >>>>> build/mix.lo build/output.lo build/playmidi.lo > >>>>> build/readmidi.lo build/resample.lo build/sdl_a.lo > >>>>> build/sdl_c.lo build/tables.lo build/timidity.lo > >>>>> build/native_midi_common.lo build/native_midi_mac.lo > >>>>> build/native_midi_macosx.lo build/native_midi_win32.lo > >>>>> build/dynamic_mp3.lo build/version.o -mwindows > >>>>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL > >>>>> -lwinmm -L/usr/lib -lsmpeg -mwindows > >>>>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm > >>>>> -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 > >>>>> -version-info 12:0:12 > >>>>> > >>>>> *** Warning: Linking the shared library > >>>>> build/libSDL_mixer.la against the non-libtool *** objects > >>>>> build/version.o is not portable! > >>>> > >>>> So what is being said is that build/version.o was not > >>>> created under the control of libtool. You need to modify the > >>>> makefile so that libtool is used to create build/version.o > >>>> instead of GCC directly. > >>>> > >>>> > >>>> > >>> OK I found the rule in the Makefile for building the > >>> "build/version.o" file: $(objects)/version.o: ./version.rc > >>> $(WINDRES) $< $@ > >>> > >>> Indeed, it uses i686-pc-mingw32-windres instead of libtool to > >>> build this file. So I replace $(WINDRES) by $(LIBTOOL): > >>> $(objects)/version.o: ./version.rc $(LIBTOOL) $< $@ I also try > >>> this: $(objects)/version.o: ./version.rc $(LIBTOOL) > >>> --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c > >>> $< -o $@ > >>> > >>> But that's not a correct usage of libtool. Indeed, windres is > >>> for manipulate Windows resources whereas libtool is for > >>> building library. > >>> > >>> Can you explain me how to change this line correctly using > >>> libtool? > >>> > >> $(LIBTOOL) --mode=compile $(WINDRES) with the right arguments > >> > > > > > > So you said I should use: $(LIBTOOL) --mode=compile $(WINDRES) with > > the right arguments... The problem is what are the right > > arguments? I never used libtool and windres. I read the libtool > > manual and "--mode" is an option of libtool. This option can > > indeed, take the "compile" value. After this, I must put the > > compile-command... Do you think $(WINDRES) is a compile-command? > > And at the end I need to put the sourcefile. Is it the .rc file? > > This is the synopsis: libtool [OPTION]... --mode=compile > > COMPILE-COMMAND... SOURCEFILE > > > > > > I started with this try (no arguments): $(objects)/version.o: > > ./version.rc $(LIBTOOL) --mode=compile $(WINDRES) Then I tested > > with this (2 arguments): $(objects)/version.o: ./version.rc > > $(LIBTOOL) --mode=compile $(WINDRES) $< $@ Finally, I try this: > > $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile > > $(WINDRES) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ > > > > But in the 3 cases, it is a bad usage of the libtool and windres > > commands. > > > > Can you explain me how to patch the Makefile in order to be able to > > build the 'build/version.o' file for my cross compile? > > > > Thank you. Regards. > > Please, delete people's e-mail addresses from your reply (or rather, > tell your e-mail client to do so), and also trim message footers when > replying. > > As for compiling, here's a part of libgcrypt Makefile.am: > > RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ > $(libgcrypt_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) > LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RCCOMPILE) > > SUFFIXES = .rc .lo > > .rc.lo: > $(LTRCCOMPILE) -i "$<" -o "$@" > > > That's how it looks in Makefile: > > RC = windres > DEFS = -DHAVE_CONFIG_H > DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) > CPPFLAGS = > LIBTOOL = $(SHELL) $(top_builddir)/libtool > RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ > $(libgcrypt_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) > > LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RCCOMPILE) > SUFFIXES = .rc .lo It seems to be not easy. I will try this later. Also, I now use GCC 4.7.1 instead of GCC 4.6.0 and now the "-pthread" option is available :) But this doesn't resolve the second problem (not protable): $ make /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o build/libSDL_mixer.la build/effect_position.lo build/effect_stereoreverse.lo build/effects_internal.lo build/load_aiff.lo build/load_voc.lo build/mixer.lo build/music.lo build/wavestream.lo build/common.lo build/ctrlmode.lo build/filter.lo build/instrum.lo build/mix.lo build/output.lo build/playmidi.lo build/readmidi.lo build/resample.lo build/sdl_a.lo build/sdl_c.lo build/tables.lo build/timidity.lo build/native_midi_common.lo build/native_midi_mac.lo build/native_midi_macosx.lo build/native_midi_win32.lo build/dynamic_mp3.lo build/version.o -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -L/usr/lib -lsmpeg -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 -version-info 12:0:12 *** Warning: Linking the shared library build/libSDL_mixer.la against the non-libtool *** objects build/version.o is not portable! libtool: link: i686-pc-mingw32-gcc -shared build/.libs/effect_position.o build/.libs/effect_stereoreverse.o build/.libs/effects_internal.o build/.libs/load_aiff.o build/.libs/load_voc.o build/.libs/mixer.o build/.libs/music.o build/.libs/wavestream.o build/.libs/common.o build/.libs/ctrlmode.o build/.libs/filter.o build/.libs/instrum.o build/.libs/mix.o build/.libs/output.o build/.libs/playmidi.o build/.libs/readmidi.o build/.libs/resample.o build/.libs/sdl_a.o build/.libs/sdl_c.o build/.libs/tables.o build/.libs/timidity.o build/.libs/native_midi_common.o build/.libs/native_midi_mac.o build/.libs/native_midi_macosx.o build/.libs/native_midi_win32.o build/.libs/dynamic_mp3.o build/version.o -L/usr/i686-pc-mingw32/lib -L/usr/lib /usr/lib/libsmpeg.so /usr/lib/libSDL.so -ldl -lvga -lpthread /usr/lib/libstdc++.so -lmingw32 /usr/i686-pc-mingw32/lib/libSDLmain.a /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm -mwindows -mwindows -pthread -o build/.libs/SDL_mixer.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker build/.libs/libSDL_mixer.dll.a /usr/lib/libsmpeg.so: could not read symbols: File in wrong format collect2: error: ld returned 1 exit status make: *** [build/libSDL_mixer.la] Error 1 As you can see now the error is about libsmpeg. It doesn't look at the good place because /usr/lib/libsmpeg.so is not the cross compile path. It should be /usr/i686-pc-mingw32/lib/libsmpeg.so. I will see if there is an option for this in the configure script... And probably I need to cross compile libsmpeg too... |
From: YuGiOhJCJ Mailing-L. <yug...@la...> - 2012-09-19 15:39:59
|
On Mon, 17 Sep 2012 21:31:28 +0200 YuGiOhJCJ Mailing-List <yug...@la...> wrote: > On Mon, 17 Sep 2012 05:33:00 +0400 > LRN <lr...@gm...> wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > On 16.09.2012 22:03, YuGiOhJCJ Mailing-List wrote: > > > On Sun, 16 Sep 2012 05:16:38 +0400 LRN wrote: > > >> On 15.09.2012 21:19, YuGiOhJCJ Mailing-List wrote: > > >>> On Sat, 15 Sep 2012 12:22:55 -0400 Earnie Boyd wrote: > > >>>> On Sat, Sep 15, 2012 at 7:41 AM, YuGiOhJCJ Mailing-List > > >>>> wrote: > > >>>>> Hello, > > >>>>> > > >>>>> I build a cross compiler for my GNU/Linux operating system > > >>>>> to build Windows binaries. To do this I compiled > > >>>>> binutils-2.21, gcc-4.6.0, mingwrt-3.15.2-mingw32 and > > >>>>> w32api-3.13-mingw32 with the correct options. It works well > > >>>>> in some cases: -compile goattracker -compile xmp -compile > > >>>>> SDL -compile SDL_ttf -compile SDL_net -compile libiconv > > >>>>> -compile zlib -compile freetype > > >>>>> > > >>>>> But in some other cases (SDL_mixer) I got a problem: $ > > >>>>> export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig > > >>>>> $ ./configure --prefix=/usr/i686-pc-mingw32 > > >>>>> --host=i686-pc-mingw32 --disable-music-mod $ make /bin/sh > > >>>>> ./libtool --mode=link i686-pc-mingw32-gcc -o > > >>>>> build/libSDL_mixer.la build/effect_position.lo > > >>>>> build/effect_stereoreverse.lo build/effects_internal.lo > > >>>>> build/load_aiff.lo build/load_voc.lo build/mixer.lo > > >>>>> build/music.lo build/wavestream.lo build/common.lo > > >>>>> build/ctrlmode.lo build/filter.lo build/instrum.lo > > >>>>> build/mix.lo build/output.lo build/playmidi.lo > > >>>>> build/readmidi.lo build/resample.lo build/sdl_a.lo > > >>>>> build/sdl_c.lo build/tables.lo build/timidity.lo > > >>>>> build/native_midi_common.lo build/native_midi_mac.lo > > >>>>> build/native_midi_macosx.lo build/native_midi_win32.lo > > >>>>> build/dynamic_mp3.lo build/version.o -mwindows > > >>>>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL > > >>>>> -lwinmm -L/usr/lib -lsmpeg -mwindows > > >>>>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm > > >>>>> -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 > > >>>>> -version-info 12:0:12 > > >>>>> > > >>>>> *** Warning: Linking the shared library > > >>>>> build/libSDL_mixer.la against the non-libtool *** objects > > >>>>> build/version.o is not portable! > > >>>> > > >>>> So what is being said is that build/version.o was not > > >>>> created under the control of libtool. You need to modify the > > >>>> makefile so that libtool is used to create build/version.o > > >>>> instead of GCC directly. > > >>>> > > >>>> > > >>>> > > >>> OK I found the rule in the Makefile for building the > > >>> "build/version.o" file: $(objects)/version.o: ./version.rc > > >>> $(WINDRES) $< $@ > > >>> > > >>> Indeed, it uses i686-pc-mingw32-windres instead of libtool to > > >>> build this file. So I replace $(WINDRES) by $(LIBTOOL): > > >>> $(objects)/version.o: ./version.rc $(LIBTOOL) $< $@ I also try > > >>> this: $(objects)/version.o: ./version.rc $(LIBTOOL) > > >>> --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c > > >>> $< -o $@ > > >>> > > >>> But that's not a correct usage of libtool. Indeed, windres is > > >>> for manipulate Windows resources whereas libtool is for > > >>> building library. > > >>> > > >>> Can you explain me how to change this line correctly using > > >>> libtool? > > >>> > > >> $(LIBTOOL) --mode=compile $(WINDRES) with the right arguments > > >> > > > > > > > > > So you said I should use: $(LIBTOOL) --mode=compile $(WINDRES) with > > > the right arguments... The problem is what are the right > > > arguments? I never used libtool and windres. I read the libtool > > > manual and "--mode" is an option of libtool. This option can > > > indeed, take the "compile" value. After this, I must put the > > > compile-command... Do you think $(WINDRES) is a compile-command? > > > And at the end I need to put the sourcefile. Is it the .rc file? > > > This is the synopsis: libtool [OPTION]... --mode=compile > > > COMPILE-COMMAND... SOURCEFILE > > > > > > > > > I started with this try (no arguments): $(objects)/version.o: > > > ./version.rc $(LIBTOOL) --mode=compile $(WINDRES) Then I tested > > > with this (2 arguments): $(objects)/version.o: ./version.rc > > > $(LIBTOOL) --mode=compile $(WINDRES) $< $@ Finally, I try this: > > > $(objects)/version.o: ./version.rc $(LIBTOOL) --mode=compile > > > $(WINDRES) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ > > > > > > But in the 3 cases, it is a bad usage of the libtool and windres > > > commands. > > > > > > Can you explain me how to patch the Makefile in order to be able to > > > build the 'build/version.o' file for my cross compile? > > > > > > Thank you. Regards. > > > > Please, delete people's e-mail addresses from your reply (or rather, > > tell your e-mail client to do so), and also trim message footers when > > replying. > > > > As for compiling, here's a part of libgcrypt Makefile.am: > > > > RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ > > $(libgcrypt_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) > > LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RCCOMPILE) > > > > SUFFIXES = .rc .lo > > > > .rc.lo: > > $(LTRCCOMPILE) -i "$<" -o "$@" > > > > > > That's how it looks in Makefile: > > > > RC = windres > > DEFS = -DHAVE_CONFIG_H > > DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) > > CPPFLAGS = > > LIBTOOL = $(SHELL) $(top_builddir)/libtool > > RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ > > $(libgcrypt_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) > > > > LTRCCOMPILE = $(LIBTOOL) --mode=compile $(RCCOMPILE) > > SUFFIXES = .rc .lo > > It seems to be not easy. > I will try this later. > Also, I now use GCC 4.7.1 instead of GCC 4.6.0 and now the "-pthread" option is available :) > > But this doesn't resolve the second problem (not protable): > $ make > /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o build/libSDL_mixer.la build/effect_position.lo build/effect_stereoreverse.lo build/effects_internal.lo build/load_aiff.lo build/load_voc.lo build/mixer.lo build/music.lo build/wavestream.lo build/common.lo build/ctrlmode.lo build/filter.lo build/instrum.lo build/mix.lo build/output.lo build/playmidi.lo build/readmidi.lo build/resample.lo build/sdl_a.lo build/sdl_c.lo build/tables.lo build/timidity.lo build/native_midi_common.lo build/native_midi_mac.lo build/native_midi_macosx.lo build/native_midi_win32.lo build/dynamic_mp3.lo build/version.o -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -L/usr/lib -lsmpeg -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lm -no-undefined -rpath /usr/i686-pc-mingw32/lib -release 1.2 -version-info 12:0:12 > > *** Warning: Linking the shared library build/libSDL_mixer.la against the non-libtool > *** objects build/version.o is not portable! > libtool: link: i686-pc-mingw32-gcc -shared build/.libs/effect_position.o build/.libs/effect_stereoreverse.o build/.libs/effects_internal.o build/.libs/load_aiff.o build/.libs/load_voc.o build/.libs/mixer.o build/.libs/music.o build/.libs/wavestream.o build/.libs/common.o build/.libs/ctrlmode.o build/.libs/filter.o build/.libs/instrum.o build/.libs/mix.o build/.libs/output.o build/.libs/playmidi.o build/.libs/readmidi.o build/.libs/resample.o build/.libs/sdl_a.o build/.libs/sdl_c.o build/.libs/tables.o build/.libs/timidity.o build/.libs/native_midi_common.o build/.libs/native_midi_mac.o build/.libs/native_midi_macosx.o build/.libs/native_midi_win32.o build/.libs/dynamic_mp3.o build/version.o -L/usr/i686-pc-mingw32/lib -L/usr/lib /usr/lib/libsmpeg.so /usr/lib/libSDL.so -ldl -lvga -lpthread /usr/lib/libstdc++.so -lmingw32 /usr/i686-pc-mingw32/lib/libSDLmain.a /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm -mwindows -mwindows -pthread -o build/.libs/SDL_mixer.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker build/.libs/libSDL_mixer.dll.a > /usr/lib/libsmpeg.so: could not read symbols: File in wrong format > collect2: error: ld returned 1 exit status > make: *** [build/libSDL_mixer.la] Error 1 > > As you can see now the error is about libsmpeg. > It doesn't look at the good place because /usr/lib/libsmpeg.so is not the cross compile path. > It should be /usr/i686-pc-mingw32/lib/libsmpeg.so. > I will see if there is an option for this in the configure script... And probably I need to cross compile libsmpeg too... OK I found the corresponding option and I cross compiled libsmpeg. Now that's what I have: $ $ export PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig $ ./configure --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32 --with-smpeg-prefix=/usr/i686-pc-mingw32 --disable-music-mod $ make /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o build/playwave.exe build/playwave.lo -D_GNU_SOURCE=1 -Dmain=SDL_main -I/usr/i686-pc-mingw32/include/SDL -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL build/libSDL_mixer.la libtool: link: i686-pc-mingw32-gcc -o build/.libs/playwave.exe build/.libs/playwave.o -D_GNU_SOURCE=1 -Dmain=SDL_main -I/usr/i686-pc-mingw32/include/SDL -mwindows -L/usr/i686-pc-mingw32/lib build/.libs/libSDL_mixer.dll.a /usr/i686-pc-mingw32/lib/libSDLmain.a /usr/i686-pc-mingw32/lib/libstdc++.dll.a -lmingw32 /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm -L/usr/i686-pc-mingw32/lib /usr/i686-pc-mingw32/lib/libmingw32.a(main.o): In function `main': /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c:73: undefined reference to `WinMain@16' collect2: error: ld returned 1 exit status make: *** [build/playwave.exe] Error 1 So I have an undefined reference and what is strange is I can see the path /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c which is the place where I built myself mingwrt. At this time, this path doesn't exists anymore. I see no reason this path is displayed on my screen... Do you understand this error message ? |
From: LRN <lr...@gm...> - 2012-09-19 15:58:54
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 19.09.2012 19:39, YuGiOhJCJ Mailing-List wrote: > OK I found the corresponding option and I cross compiled libsmpeg. > Now that's what I have: $ $ export > PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig $ ./configure > --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32 > --with-smpeg-prefix=/usr/i686-pc-mingw32 --disable-music-mod $ > make /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o > build/playwave.exe build/playwave.lo -D_GNU_SOURCE=1 > -Dmain=SDL_main -I/usr/i686-pc-mingw32/include/SDL -mwindows > -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL > build/libSDL_mixer.la libtool: link: i686-pc-mingw32-gcc -o > build/.libs/playwave.exe build/.libs/playwave.o -D_GNU_SOURCE=1 > -Dmain=SDL_main -I/usr/i686-pc-mingw32/include/SDL -mwindows > -L/usr/i686-pc-mingw32/lib build/.libs/libSDL_mixer.dll.a > /usr/i686-pc-mingw32/lib/libSDLmain.a > /usr/i686-pc-mingw32/lib/libstdc++.dll.a -lmingw32 > /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm > -L/usr/i686-pc-mingw32/lib > /usr/i686-pc-mingw32/lib/libmingw32.a(main.o): In function `main': > /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c:73: > undefined reference to `WinMain@16' collect2: error: ld returned 1 > exit status make: *** [build/playwave.exe] Error 1 > > So I have an undefined reference and what is strange is I can see > the path > /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c > which is the place where I built myself mingwrt. At this time, this > path doesn't exists anymore. I see no reason this path is displayed > on my screen... > > Do you understand this error message ? > Link libSDLmain after -lmingw32 (or, rather, link -lmingw32 before libSDLmain). I hate libSDLmain for that reason, and i've heard that in SDL 2.x it will be going away. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBAgAGBQJQWeuuAAoJEOs4Jb6SI2CwIHoH/RShbl/otEGbTkKY8k68TYET UsjNQgqq+cQKpVXwpOGYfBAgS8vc7LzIgKLOYo62FEL3emLwbevfy35p7LwVMeQk UDe44F6Oq328YiQ+q/scwuKC5OHmCicGTBXRRIZ7MvzjS3BJJw2tZjwhU3zev8u3 wHAvVXWHAHXEA82iEER35p3KYKm0+r68OCoMXJU/VPddf1Dl8xwCvv1eZeWQ4cw9 JfO7ED1cSdONE+dMXYVwPXyxZROVWvPlIww1xe2Jon+irJBXgiTJ9xVS7CN/nZcl I5PhTu/7l9On4QlVM3v24Pe0POY+tuXC7zpPqPyHn7msXj5xIu3Mc9eMMp5BTY8= =qVmE -----END PGP SIGNATURE----- |
From: YuGiOhJCJ Mailing-L. <yug...@la...> - 2012-09-19 17:11:45
|
On Wed, 19 Sep 2012 19:58:39 +0400 LRN <lr...@gm...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 19.09.2012 19:39, YuGiOhJCJ Mailing-List wrote: > > OK I found the corresponding option and I cross compiled libsmpeg. > > Now that's what I have: $ $ export > > PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig $ ./configure > > --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32 > > --with-smpeg-prefix=/usr/i686-pc-mingw32 --disable-music-mod $ > > make /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o > > build/playwave.exe build/playwave.lo -D_GNU_SOURCE=1 > > -Dmain=SDL_main -I/usr/i686-pc-mingw32/include/SDL -mwindows > > -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL > > build/libSDL_mixer.la libtool: link: i686-pc-mingw32-gcc -o > > build/.libs/playwave.exe build/.libs/playwave.o -D_GNU_SOURCE=1 > > -Dmain=SDL_main -I/usr/i686-pc-mingw32/include/SDL -mwindows > > -L/usr/i686-pc-mingw32/lib build/.libs/libSDL_mixer.dll.a > > /usr/i686-pc-mingw32/lib/libSDLmain.a > > /usr/i686-pc-mingw32/lib/libstdc++.dll.a -lmingw32 > > /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm > > -L/usr/i686-pc-mingw32/lib > > /usr/i686-pc-mingw32/lib/libmingw32.a(main.o): In function `main': > > /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c:73: > > undefined reference to `WinMain@16' collect2: error: ld returned 1 > > exit status make: *** [build/playwave.exe] Error 1 > > > > So I have an undefined reference and what is strange is I can see > > the path > > /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c > > which is the place where I built myself mingwrt. At this time, this > > path doesn't exists anymore. I see no reason this path is displayed > > on my screen... > > > > Do you understand this error message ? > > > Link libSDLmain after -lmingw32 (or, rather, link -lmingw32 before > libSDLmain). > I hate libSDLmain for that reason, and i've heard that in SDL 2.x it > will be going away. > Yes it's an order problem. But -lmingw32 is correctly ordered in the Makefile as you can see here: $ cat Makefile | grep lSDLmain EXTRA_LDFLAGS = -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -L/usr/i686-pc-mingw32/lib -lsmpeg -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -mwindows -lm SDL_LIBS = -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL I have the order -lmingw32 -lSDLmain -lSDL which is correct. The rule corresponding use the variables like this in the Makefile: $(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET) $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) Do you see where is the problem in these lines? |
From: LRN <lr...@gm...> - 2012-09-19 18:08:25
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 19.09.2012 21:11, YuGiOhJCJ Mailing-List wrote: > On Wed, 19 Sep 2012 19:58:39 +0400 LRN <lr...@gm...> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >> >> On 19.09.2012 19:39, YuGiOhJCJ Mailing-List wrote: >>> OK I found the corresponding option and I cross compiled >>> libsmpeg. Now that's what I have: $ $ export >>> PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig $ >>> ./configure --prefix=/usr/i686-pc-mingw32 >>> --host=i686-pc-mingw32 --with-smpeg-prefix=/usr/i686-pc-mingw32 >>> --disable-music-mod $ make /bin/sh ./libtool --mode=link >>> i686-pc-mingw32-gcc -o build/playwave.exe build/playwave.lo >>> -D_GNU_SOURCE=1 -Dmain=SDL_main >>> -I/usr/i686-pc-mingw32/include/SDL -mwindows >>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL >>> build/libSDL_mixer.la libtool: link: i686-pc-mingw32-gcc -o >>> build/.libs/playwave.exe build/.libs/playwave.o >>> -D_GNU_SOURCE=1 -Dmain=SDL_main >>> -I/usr/i686-pc-mingw32/include/SDL -mwindows >>> -L/usr/i686-pc-mingw32/lib build/.libs/libSDL_mixer.dll.a >>> /usr/i686-pc-mingw32/lib/libSDLmain.a >>> /usr/i686-pc-mingw32/lib/libstdc++.dll.a -lmingw32 >>> /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm >>> -L/usr/i686-pc-mingw32/lib >>> /usr/i686-pc-mingw32/lib/libmingw32.a(main.o): In function >>> `main': >>> /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c:73: >>> >>> undefined reference to `WinMain@16' collect2: error: ld returned 1 >>> exit status make: *** [build/playwave.exe] Error 1 >>> >>> So I have an undefined reference and what is strange is I can >>> see the path >>> /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c >>> >>> which is the place where I built myself mingwrt. At this time, this >>> path doesn't exists anymore. I see no reason this path is >>> displayed on my screen... >>> >>> Do you understand this error message ? >>> >> Link libSDLmain after -lmingw32 (or, rather, link -lmingw32 >> before libSDLmain). I hate libSDLmain for that reason, and i've >> heard that in SDL 2.x it will be going away. >> > > Yes it's an order problem. But -lmingw32 is correctly ordered in > the Makefile as you can see here: $ cat Makefile | grep lSDLmain > EXTRA_LDFLAGS = -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 > -lSDLmain -lSDL -lwinmm -L/usr/i686-pc-mingw32/lib -lsmpeg > -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -mwindows -lm > SDL_LIBS = -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain > -lSDL > > I have the order -lmingw32 -lSDLmain -lSDL which is correct. > > The rule corresponding use the variables like this in the > Makefile: $(objects)/playwave$(EXE): $(objects)/playwave.lo > $(objects)/$(TARGET) $(LIBTOOL) --mode=link $(CC) -o $@ > $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) > $(objects)/$(TARGET) > > Do you see where is the problem in these lines? > No idea. If you look at your output earlier, you'll see that indeed: /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o build/playwave.exe build/playwave.lo -D_GNU_SOURCE=1 -Dmain=SDL_main - -I/usr/i686-pc-mingw32/include/SDL -mwindows - -L/usr/i686-pc-mingw32/lib *-lmingw32 -lSDLmain -lSDL* build/libSDL_mixer.la That is, mingw32 is linked before SDLmain. However, what libtool does is quite different: libtool: link: i686-pc-mingw32-gcc -o build/.libs/playwave.exe build/.libs/playwave.o -D_GNU_SOURCE=1 -Dmain=SDL_main - -I/usr/i686-pc-mingw32/include/SDL -mwindows - -L/usr/i686-pc-mingw32/lib build/.libs/libSDL_mixer.dll.a */usr/i686-pc-mingw32/lib/libSDLmain.a* /usr/i686-pc-mingw32/lib/libstdc++.dll.a *-lmingw32 /usr/i686-pc-mingw32/lib/libSDL.dll.a* -luser32 -lgdi32 -lwinmm - -L/usr/i686-pc-mingw32/lib That is, SDLmain is linked before mingw32. Sadly, i'm not a libtool wizard, so there's little i can do to help you. However, i think it would be worth a shot to see how SDL test applications are built. _they_ don't have this problem. Also, try asking in SDL-specific places, SDL users probably hit this issue a number of times. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBAgAGBQJQWgoJAAoJEOs4Jb6SI2Cw5agH/2dStFljOWkxBkMhypN21Mn5 vWDhnnx5xDiMhpjVP3DJwpfOzrChBCPrrjtg6wpRgOe3N6wuwhljLPfIvYo1dpy3 Hfn68ugEezmNQztCv50Nig8bzG/ByBEbwDxU09zrVvwcIGNLsTewsMyyeIEOco18 KOOUMOvkzvYsAVNhGUPAYUxM9S4owuq6gNTJPkMqUZ3KHfg3QPpEWIZDGy59Mj3l H/ObZCjsqBKgjWx2BSXDmVuErRVgeVs7VQX5Qg/moJfSDqjSLhIhs6nuy1xIbJu2 qbWuokV86BjtOUew+ipBiOy0qHCFe3GWFE869bagdbEYXSV7cG+gW6DRSxZKuYA= =ntHl -----END PGP SIGNATURE----- |
From: YuGiOhJCJ Mailing-L. <yug...@la...> - 2012-09-19 19:51:38
|
On Wed, 19 Sep 2012 22:08:11 +0400 LRN <lr...@gm...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 19.09.2012 21:11, YuGiOhJCJ Mailing-List wrote: > > On Wed, 19 Sep 2012 19:58:39 +0400 LRN <lr...@gm...> wrote: > > > >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > >> > >> On 19.09.2012 19:39, YuGiOhJCJ Mailing-List wrote: > >>> OK I found the corresponding option and I cross compiled > >>> libsmpeg. Now that's what I have: $ $ export > >>> PKG_CONFIG_PATH=/usr/i686-pc-mingw32/lib/pkgconfig $ > >>> ./configure --prefix=/usr/i686-pc-mingw32 > >>> --host=i686-pc-mingw32 --with-smpeg-prefix=/usr/i686-pc-mingw32 > >>> --disable-music-mod $ make /bin/sh ./libtool --mode=link > >>> i686-pc-mingw32-gcc -o build/playwave.exe build/playwave.lo > >>> -D_GNU_SOURCE=1 -Dmain=SDL_main > >>> -I/usr/i686-pc-mingw32/include/SDL -mwindows > >>> -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL > >>> build/libSDL_mixer.la libtool: link: i686-pc-mingw32-gcc -o > >>> build/.libs/playwave.exe build/.libs/playwave.o > >>> -D_GNU_SOURCE=1 -Dmain=SDL_main > >>> -I/usr/i686-pc-mingw32/include/SDL -mwindows > >>> -L/usr/i686-pc-mingw32/lib build/.libs/libSDL_mixer.dll.a > >>> /usr/i686-pc-mingw32/lib/libSDLmain.a > >>> /usr/i686-pc-mingw32/lib/libstdc++.dll.a -lmingw32 > >>> /usr/i686-pc-mingw32/lib/libSDL.dll.a -luser32 -lgdi32 -lwinmm > >>> -L/usr/i686-pc-mingw32/lib > >>> /usr/i686-pc-mingw32/lib/libmingw32.a(main.o): In function > >>> `main': > >>> /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c:73: > >>> > >>> > undefined reference to `WinMain@16' collect2: error: ld returned 1 > >>> exit status make: *** [build/playwave.exe] Error 1 > >>> > >>> So I have an undefined reference and what is strange is I can > >>> see the path > >>> /home/yugiohjcj/documents/downloads/software/mingwrt-3.15.2-mingw32/main.c > >>> > >>> > which is the place where I built myself mingwrt. At this time, this > >>> path doesn't exists anymore. I see no reason this path is > >>> displayed on my screen... > >>> > >>> Do you understand this error message ? > >>> > >> Link libSDLmain after -lmingw32 (or, rather, link -lmingw32 > >> before libSDLmain). I hate libSDLmain for that reason, and i've > >> heard that in SDL 2.x it will be going away. > >> > > > > Yes it's an order problem. But -lmingw32 is correctly ordered in > > the Makefile as you can see here: $ cat Makefile | grep lSDLmain > > EXTRA_LDFLAGS = -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 > > -lSDLmain -lSDL -lwinmm -L/usr/i686-pc-mingw32/lib -lsmpeg > > -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -mwindows -lm > > SDL_LIBS = -mwindows -L/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain > > -lSDL > > > > I have the order -lmingw32 -lSDLmain -lSDL which is correct. > > > > The rule corresponding use the variables like this in the > > Makefile: $(objects)/playwave$(EXE): $(objects)/playwave.lo > > $(objects)/$(TARGET) $(LIBTOOL) --mode=link $(CC) -o $@ > > $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) > > $(objects)/$(TARGET) > > > > Do you see where is the problem in these lines? > > > No idea. If you look at your output earlier, you'll see that indeed: > > /bin/sh ./libtool --mode=link i686-pc-mingw32-gcc -o > build/playwave.exe build/playwave.lo -D_GNU_SOURCE=1 -Dmain=SDL_main > - -I/usr/i686-pc-mingw32/include/SDL -mwindows > - -L/usr/i686-pc-mingw32/lib *-lmingw32 -lSDLmain -lSDL* > build/libSDL_mixer.la > > That is, mingw32 is linked before SDLmain. > However, what libtool does is quite different: > > libtool: link: i686-pc-mingw32-gcc -o build/.libs/playwave.exe > build/.libs/playwave.o -D_GNU_SOURCE=1 -Dmain=SDL_main > - -I/usr/i686-pc-mingw32/include/SDL -mwindows > - -L/usr/i686-pc-mingw32/lib build/.libs/libSDL_mixer.dll.a > */usr/i686-pc-mingw32/lib/libSDLmain.a* > /usr/i686-pc-mingw32/lib/libstdc++.dll.a *-lmingw32 > /usr/i686-pc-mingw32/lib/libSDL.dll.a* -luser32 -lgdi32 -lwinmm > - -L/usr/i686-pc-mingw32/lib > > That is, SDLmain is linked before mingw32. > Sadly, i'm not a libtool wizard, so there's little i can do to help you. > However, i think it would be worth a shot to see how SDL test > applications are built. _they_ don't have this problem. Also, try > asking in SDL-specific places, SDL users probably hit this issue a > number of times. > Thank you to all for these advices. I wish you a happy hacking :) |