MinGW Make Compile Error

Post Reply
MinePlayer
New member
Posts: 4
Joined: Sun Oct 28, 2018 08:08
In-game: Player5

MinGW Make Compile Error

by MinePlayer » Post

I'm have compile error when i'm try to build minetest on windows 10.

Code: Select all

[  1%] Built target jsoncpp
[  1%] Built target GenerateVersion
[  1%] Built target cguittfont
[  1%] Building CXX object src/CMakeFiles/minetest.dir/client/clientlauncher.cpp.obj
In file included from C:/Users/User/Desktop/DIR/minetest/src/log.h:27:0,
                 from C:/Users/User/Desktop/DIR/minetest/src/debug.h:27,
                 from C:/Users/User/Desktop/DIR/minetest/src/mainmenumanager.h:26,
                 from C:\Users\User\Desktop\DIR\minetest\src\client\clientlauncher.cpp:20:
C:/Users/User/Desktop/DIR/minetest/src/threads.h:63:15: error: 'thread' in namespace 'std' does not name a type
  typedef std::thread::id threadid_t;
               ^~~~~~
C:/Users/User/Desktop/DIR/minetest/src/threads.h:64:15: error: 'thread' in namespace 'std' does not name a type
  typedef std::thread::native_handle_type threadhandle_t;
               ^~~~~~
C:/Users/User/Desktop/DIR/minetest/src/threads.h:85:8: error: 'threadid_t' does not name a type
 inline threadid_t thr_get_current_thread_id()
        ^~~~~~~~~~
C:/Users/User/Desktop/DIR/minetest/src/threads.h:96:35: error: 'thr_compare_thread_id' declared as an 'inline' variable
 inline bool thr_compare_thread_id(threadid_t thr1, threadid_t thr2)
                                   ^~~~~~~~~~
C:/Users/User/Desktop/DIR/minetest/src/threads.h:96:35: error: 'threadid_t' was not declared in this scope
C:/Users/User/Desktop/DIR/minetest/src/threads.h:96:52: error: 'threadid_t' was not declared in this scope
 inline bool thr_compare_thread_id(threadid_t thr1, threadid_t thr2)
                                                    ^~~~~~~~~~
C:/Users/User/Desktop/DIR/minetest/src/threads.h:96:67: error: expression list treated as compound expression in initializer [-fpermissive]
 inline bool thr_compare_thread_id(threadid_t thr1, threadid_t thr2)
                                                                   ^
C:/Users/User/Desktop/DIR/minetest/src/threads.h:105:35: error: 'thr_is_current_thread' declared as an 'inline' variable
 inline bool thr_is_current_thread(threadid_t thr)
                                   ^~~~~~~~~~
C:/Users/User/Desktop/DIR/minetest/src/threads.h:105:35: error: 'threadid_t' was not declared in this scope
In file included from C:/Users/User/Desktop/DIR/minetest/src/debug.h:27:0,
                 from C:/Users/User/Desktop/DIR/minetest/src/mainmenumanager.h:26,
                 from C:\Users\User\Desktop\DIR\minetest\src\client\clientlauncher.cpp:20:
C:/Users/User/Desktop/DIR/minetest/src/log.h:81:11: error: 'threadid_t' was not declared in this scope
  std::map<threadid_t, std::string> m_thread_names;
           ^~~~~~~~~~
C:/Users/User/Desktop/DIR/minetest/src/log.h:81:34: error: template argument 1 is invalid
  std::map<threadid_t, std::string> m_thread_names;
                                  ^
C:/Users/User/Desktop/DIR/minetest/src/log.h:81:34: error: template argument 3 is invalid
C:/Users/User/Desktop/DIR/minetest/src/log.h:81:34: error: template argument 4 is invalid
In file included from C:/Users/User/Desktop/DIR/minetest/src/util/thread.h:24:0,
                 from C:/Users/User/Desktop/DIR/minetest/src/network/connection.h:30,
                 from C:/Users/User/Desktop/DIR/minetest/src/server.h:23,
                 from C:\Users\User\Desktop\DIR\minetest\src\client\clientlauncher.cpp:23:
c:\users\user\desktop\dir\minetest\src\threading\thread.h:96:9: error: 'threadid_t' does not name a type
  inline threadid_t getThreadId() { return m_thread_obj->get_id(); }
         ^~~~~~~~~~
c:\users\user\desktop\dir\minetest\src\threading\thread.h:97:9: error: 'threadhandle_t' does not name a type
  inline threadhandle_t getThreadHandle() { return m_thread_obj->native_handle(); }
         ^~~~~~~~~~~~~~
c:\users\user\desktop\dir\minetest\src\threading\thread.h:159:7: error: 'thread' in namespace 'std' does not name a type
  std::thread *m_thread_obj;
       ^~~~~~
c:\users\user\desktop\dir\minetest\src\threading\thread.h: In member function 'bool Thread::isCurrentThread()':
c:\users\user\desktop\dir\minetest\src\threading\thread.h:90:68: error: 'getThreadId' was not declared in this scope
  bool isCurrentThread() { return thr_is_current_thread(getThreadId()); }
                                                                    ^
c:\users\user\desktop\dir\minetest\src\threading\thread.h:90:69: error: 'thr_is_current_thread' cannot be used as a function
  bool isCurrentThread() { return thr_is_current_thread(getThreadId()); }
                                                                     ^
C:\Users\User\Desktop\DIR\minetest\src\client\clientlauncher.cpp: In member function 'bool ClientLauncher::run(GameParams&, const Settings&)':
C:\Users\User\Desktop\DIR\minetest\src\client\clientlauncher.cpp:170:24: error: 'g_version_hash' was not declared in this scope
    L" " + utf8_to_wide(g_version_hash) +
                        ^~~~~~~~~~~~~~
src\CMakeFiles\minetest.dir\build.make:66: recipe for target 'src/CMakeFiles/minetest.dir/client/clientlauncher.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/minetest.dir/client/clientlauncher.cpp.obj] Error 1
CMakeFiles\Makefile2:170: recipe for target 'src/CMakeFiles/minetest.dir/all' failed
mingw32-make[1]: *** [src/CMakeFiles/minetest.dir/all] Error 2
Makefile:150: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

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

Re: MinGW Make Compile Error

by sfan5 » Post

Minetest requires at least C++11 support, your MinGW version is too old.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

MinePlayer
New member
Posts: 4
Joined: Sun Oct 28, 2018 08:08
In-game: Player5

Re: MinGW Make Compile Error

by MinePlayer » Post

Oh thx! i'm try to compile it again.

MinePlayer
New member
Posts: 4
Joined: Sun Oct 28, 2018 08:08
In-game: Player5

Re: MinGW Make Compile Error

by MinePlayer » Post

I'm try compile again...

Code: Select all

[  0%] Building CXX object src/cguittfont/CMakeFiles/cguittfont.dir/xCGUITTFont.cpp.obj
[  0%] Linking CXX static library libcguittfont.a
[  0%] Built target cguittfont
[  0%] Built target GenerateVersion
Scanning dependencies of target minetest
[  0%] Building CXX object src/CMakeFiles/minetest.dir/client/clientlauncher.cpp.obj
C:\Users\User\Desktop\DIR\minetest\src\client\clientlauncher.cpp: In member function 'bool ClientLauncher::run(GameParams&, const Settings&)':
C:\Users\User\Desktop\DIR\minetest\src\client\clientlauncher.cpp:170:24: error: 'g_version_hash' was not declared in this scope
    L" " + utf8_to_wide(g_version_hash) +
                        ^~~~~~~~~~~~~~
mingw32-make[2]: *** [src\CMakeFiles\minetest.dir\build.make:67: src/CMakeFiles/minetest.dir/client/clientlauncher.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:149: src/CMakeFiles/minetest.dir/all] Error 2
mingw32-make: *** [Makefile:151: all] Error 2

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: MinGW Make Compile Error

by Lejo » Post

I have the same problem on ubuntu 18.04 which mingw version do I need?

MinePlayer
New member
Posts: 4
Joined: Sun Oct 28, 2018 08:08
In-game: Player5

Re: MinGW Make Compile Error

by MinePlayer » Post

Lejo wrote:I have the same problem on ubuntu 18.04 which mingw version do I need?
Lejo open terminal and write:

Code: Select all

 $ sudo apt install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
Then open minetest folder in terminal and write:

Code: Select all

/PATH/TO/MINETEST/ $ cmake . -DRUN_IN_PLACE=True
Then write:

Code: Select all

/PATH/TO/MINETEST $ make
After build write:

Code: Select all

/PATH/TO/MINETEST $ ./bin/minetest
Done.

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: MinGW Make Compile Error

by Lejo » Post

I don‘t mean this build.
I mean creating a windows build using buildbot
The Linux build works for me, but not the windows build.

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: MinGW Make Compile Error

by Lejo » Post

I did it on Ubuntu 18.04
First I installed mingw:

Code: Select all

sudo apt-get install mingw-w64
Then I setted the default compiler to posix:

Code: Select all

sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
And the same for this:

Code: Select all

sudo update-alternatives --config x86_64-w64-mingw32-gcc# Set the default mingw32 gcc compiler option to posix.
Source of this part of the Solution
Next you run buildbot64.sh
Then you go to BUILDPATH/minetest/_build/ and unzip the archive.
And last you add this files to the bin folder: libgcc*.dll, libstdc++*.dll and libwinpthread*.dll
I'm not sure where to take them from, I just took them from the last windows release.

Is there any better way to get the *.dll files from?

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

Re: MinGW Make Compile Error

by sfan5 » Post

Lejo wrote:Is there any better way to get the *.dll files from?
Yes, you can find them in /usr/x86_64-w64-mingw32/bin
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
Lejo
Member
Posts: 718
Joined: Mon Oct 19, 2015 16:32
GitHub: Lejo1
In-game: Lejo

Re: MinGW Make Compile Error

by Lejo » Post

I tried to get them from there based on:https://github.com/minetest/minetest/bl ... lab-ci.yml
But I didn’t found them.
Maybe that’s because of the different Ubuntu release and with that because of the different mingw-w64 package.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests