Linker error when compiling GODOT under Windows 10x64 with scons and mingw

Ivailo BurovIvailo Burov Posts: 3Member
edited June 6 in Programming

Hi,
I tried to compile godot-master branch under Windows 10x64, 64 bit CPU AMD A8 6660K with scons and gcc(mingw), but get this linking error:
bC:/Users/Admin/scoop/apps/gcc/current/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `platform\windows\godot_res.windows.opt.tools.64.o' is incompatible with i386:x86-64 output\r\ncollect2.exe: error: ld returned 1 exit status\n

scons: *** [bin\godot.windows.opt.tools.64.exe] Error 1
scons: building terminated because of errors.

I installed scoop, gcc and python as described in docs:
iwr -useb get.scoop.sh | iex
scoop install gcc python scons yasm make

Trying
scons platform=windows target=release_debug
and many options, but get the same error.

Can anyone help with this issue?

Answers

  • bitshift-rbitshift-r Posts: 55Member

    It looks like you're using the 32 bit version of mingw. You can tell by some of the messages - e.g. i386 refers to the Intel 80386 processor which is only 32bit. Plus your paths refer to mingw32. It's not so clear because there's plenty of 64bit references in there as well, but it just means that you;re running a 32bit compiler on a 64bit system. I would uninstall and reinstall mingw, and make sure to choose to install only the 64bit version with posix threading.
    I'm on Linux, but I'll fire up a Windows VM and run the installer myself to make sure I can speficy the correct options.

  • bitshift-rbitshift-r Posts: 55Member

    I downloaded it from mingw-w64.org and chose x86_64 for Architecture, and posix for Threads.

    That should do it.

  • Ivailo BurovIvailo Burov Posts: 3Member

    I tried, however seems this build is obsolete:

    Using MinGW
    Detected GCC 8 version < 8.4, which is not supported due to a regression in its C++17 guaranteed copy elision support. Use a newer GCC version, or Clang 6 or later by passing "use_llvm=yes" to the SCons command line.

    Then I installed the latest windows build MSYS2, however there are another error appears:

    scons: *** While building ['C:\\godot\\thirdparty\\nanosvg\\nanosvg.windows.opt.tools.64.obj']' from['C:\godot\thirdparty\nanosvg\nanosvg.cc']': Don't know how to build from a source file with suffix `.cc'. Expected a suffix in this list: ['.c', '.cpp', '.f', '.for', '.ftn', '.F', '.FOR', '.FTN', '.fpp', '.FPP', '.f77', '.F77', '.f90', '.F90', '.f95', '.F95', '.f03', '.F03', '.f08', '.F08', '.s', '.asm', '.ASM', '.S', '.spp', '.SPP', '.sx', '.d'].
    File "C:\godot\methods.py", line 23, in add_source_files

  • Ivailo BurovIvailo Burov Posts: 3Member

    Hi all,
    I tried to compile again with GCC 10.1.0 + LLVM/Clang/LLD/LLDB 10.0.0 + MinGW-w64 7.0.0 - release 3 (LATEST). Here is a link: http://winlibs.com/
    However the same at first post error appears. I cannot find any 64bit addition option, so I've give up.
    Just downloaded MS Visual Studio 2019 Community edition and compiled Godot 3.2.2 RC without any tricks, paths and additional options.
    So, if anyone have success with mingw and Windows could share own experience here.
    In the end, for me, VC is the only option so far, as much as I didn't want to install it.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file