Another Newbie needs help

Tony
2012-04-29
2013-06-06
  • Tony
    Tony
    2012-04-29

    environment: GCC-4.6.3-with-ada/mingw-w64-gcc-4.6.3-runtime-2.0.1-static-ada-20120321.7z  on
    Windows 7 (64 bit). Compiling 64bit apps are fine but I get a slew of linker related errors when I try to compile a 32bit app:
    gcc -mwindows -mwin32 -m32 -o rn.exe rn.c 2> error.log

    c:/tools/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/tools/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/lib/libmingw32.a when searching for -lmingw32
    c:/tools/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/tools/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/lib\libmingw32.a when searching for -lmingw32
    c:/tools/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/tools/mingw64/bin/../../MinGW64/mingw/lib/libmingw32.a when searching for -lmingw32

    and the same errors for the following..

    libgcc.a when searching for -lgcc
    libmoldname.a when searching for -lmoldname
    libmingwex.a when searching for -lmingwex

    Is this a configuration error or am I compiling with the right flags?

    Any help would be greatly appreciated.

    -Tony

     
  • Tony
    Tony
    2012-04-29

    Sorry, I meant wrong flags.

    -Tony

     
  • Jonathan Yong
    Jonathan Yong
    2012-04-29

    These are warnings, not errors, are you sure your toolchain is multilib capable? Please put up "gcc -v" if you're not sure.

     
  • Tony
    Tony
    2012-04-29

    $ gcc -v
    Using built-in specs.
    COLLECT_GCC=c:\tools\mingw64\bin\gcc.exe
    COLLECT_LTO_WRAPPER=c:/tools/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.6.3
    /lto-wrapper.exe
    Target: x86_64-w64-mingw32…
    Thread model: win32
    gcc version 4.6.3 (GCC)

    I guess this page ( https://sourceforge.net/projects/mingw-w64/ ) is a little misleading.
    "MinGW-w64 - for 32 and 64 bit Windows " Why would I need another toolchain if it has both 64 and 32 bit compilers.

    -Tony

     
  • Jonathan Yong
    Jonathan Yong
    2012-04-29

    Put the whole output, not half of it.

    For the name, no, it has nothing to do with multilib capability, it means it can be configured to produce both win32 and win64 executables. At the same time? Yes, but it depends on how your toolchain is built. Now please post the "full gcc -v" output.

     
  • NightStrike
    NightStrike
    2012-05-01

    Tony, what Jon is driving at is that the output of gcc's "-v" option will give a lot of information as to how the particular gcc you are using was configured and built.  That information will make it a lot easier to solve your problem.

    Regarding your other question, to expand on Jon's other point, this project works on products to support both 32-bit and 64-bit Windows.  That may mean, however, that you might need to download more than one toolchain, depending on what you download.  Some are multilib capable, others are not.

    Are you familiar with the difference between having one toolchain that is multilib capable, and having two separate toolchains that target different platforms?