[Help] Error on cross-platform build using VM Linux (Ubuntu)

Post Reply
User avatar
sirrobzeroone
Member
Posts: 191
Joined: Mon Jul 16, 2018 07:56

[Help] Error on cross-platform build using VM Linux (Ubuntu)

by sirrobzeroone » Post

I've been trying a few different ways to compile for windows, had a few successes and quiet a few fails.

I set up a virtual machine with a fresh ubuntu install and followed the instructions and everything seemed to compile okay until right at the end, then im seeing this output right at the end, I have no clue this error means and googling dosent reveal much except "bad". IS this somethign todo with using a virtual machine to compile a win64 build?

Thanks for any help or were to start looking.

edit im using - buildwin64.sh, ubuntu 64bit 20.04, Virtual box 6.1.

Code: Select all

[100%] Linking CXX executable ../../bin/minetest.exe
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(event.cpp.obj):event.cpp:(.text+0x37): undefined reference to `std::condition_variable::wait(std::unique_lock<std::mutex>&)'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(event.cpp.obj):event.cpp:(.text+0xa5): undefined reference to `std::condition_variable::notify_one()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(thread.cpp.obj):thread.cpp:(.text+0x22b): undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(thread.cpp.obj):thread.cpp:(.text+0x335): undefined reference to `std::thread::join()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(thread.cpp.obj):thread.cpp:(.text+0x5a1): undefined reference to `std::thread::hardware_concurrency()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(thread.cpp.obj):thread.cpp:(.text$_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvP6ThreadES4_EEEEED1Ev[_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvP6ThreadES4_EEEEED1Ev]+0xb): undefined reference to `std::thread::_State::~_State()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(thread.cpp.obj):thread.cpp:(.text$_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvP6ThreadES4_EEEEED0Ev[_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvP6ThreadES4_EEEEED0Ev]+0x14): undefined reference to `std::thread::_State::~_State()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(emerge.cpp.obj):emerge.cpp:(.text+0x1c08): undefined reference to `std::condition_variable::~condition_variable()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(emerge.cpp.obj):emerge.cpp:(.text+0x2563): undefined reference to `std::condition_variable::condition_variable()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(emerge.cpp.obj):emerge.cpp:(.text+0x2772): undefined reference to `std::condition_variable::~condition_variable()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(emerge.cpp.obj):emerge.cpp:(.text$_ZN12EmergeThreadD0Ev[_ZN12EmergeThreadD0Ev]+0x15a): undefined reference to `std::condition_variable::~condition_variable()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(emerge.cpp.obj):emerge.cpp:(.text$_ZN12EmergeThreadD1Ev[_ZN12EmergeThreadD1Ev]+0x15a): undefined reference to `std::condition_variable::~condition_variable()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(httpfetch.cpp.obj):httpfetch.cpp:(.text+0x2dca): undefined reference to `std::condition_variable::condition_variable()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(httpfetch.cpp.obj):httpfetch.cpp:(.text+0x2e03): undefined reference to `std::condition_variable::~condition_variable()'
/usr/bin/x86_64-w64-mingw32-ld: CMakeFiles/minetest.dir/objects.a(httpfetch.cpp.obj):httpfetch.cpp:(.text+0x2ece): undefined reference to `std::condition_variable::~condition_variable()'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/minetest.dir/build.make:4667: ../bin/minetest.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:504: src/CMakeFiles/minetest.dir/all] Error 2
make: *** [Makefile:152: all] Error 2


User avatar
sfan5
Moderator
Posts: 3929
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: [Help] Error on cross-platform build using VM Linux (Ubuntu)

by sfan5 » Post

Ubuntu has two variants of MinGW gcc in its repos: x86_64-w64-mingw32-win32 and x86_64-w64-mingw32-gcc-posix.
The win32 variant is missing support for POSIX Threads, which Minetest needs. So you'll need to somehow make the buildscript use the "posix" one.

Editing the toolchain file used by the buildbot to say x86_64-w64-mingw32-gcc-posix and x86_64-w64-mingw32-g++-posix should work.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
sirrobzeroone
Member
Posts: 191
Joined: Mon Jul 16, 2018 07:56

Re: [Help] Error on cross-platform build using VM Linux (Ubuntu)

by sirrobzeroone » Post

Thanks Sfan, that fixed it.

Much easier to compile running VM linux than the other methods I've tried.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest