Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't compile with mingw64 #1150

Open
Dharmesh946 opened this issue Mar 12, 2021 · 8 comments
Open

can't compile with mingw64 #1150

Dharmesh946 opened this issue Mar 12, 2021 · 8 comments

Comments

@Dharmesh946
Copy link

Hi

I tried to compile MRPT on windows with mingw64:
I have created a build directory next to the CMakeLists.txt file

cd build
cmake-gui ..
configure
generate
make

I have directly the following error:
Building CXX object libs/core/CMakeFiles/core.dir/src/WorkerThreadsPool.cpp.obj
In function 'void mySetThreadName(const string&, std::thread&)':
error: 'SetThreadDescription' was not declared in this scope
SetThreadDescription(theThread.native_handle(), wName);

I can't find any reference to that issue anywhere.

Help would be appreciated. Regards

@jlblancoc
Copy link
Member

jlblancoc commented Mar 12, 2021 via email

@Dharmesh946
Copy link
Author

Hi,

I compile OpenCV and wxWidgets from sources (with mingw64) and provided them to MRPT.
For Eigen3 I'm currently using the embedded version though I've got another one installed.
wxWidgets was compiled using instructions from MRPT web site.

Regards

@jlblancoc
Copy link
Member

Hi!

I fixed all mingw errors I could find. Could you give it a try now, please? (develop git branch)

@Dharmesh946
Copy link
Author

Hi,

Sorry for the delay.
I've just tried, same error:
In function 'void mySetThreadName(const string&, std::thread&)':
error: 'SetThreadDescription' was not declared in this scope
SetThreadDescription(theThread.native_handle(), wName);
note: suggested alternative: 'SetThreadDesktop'
SetThreadDescription(theThread.native_handle(), wName);
Regards

@jlblancoc
Copy link
Member

Hmm... have you updated your git repository first? Did you check out the develop branch? 🤨 😄

@Dharmesh946
Copy link
Author

Sorry, but yes I did...

D.

@Dharmesh946
Copy link
Author

FYI, cmake configuration:
OpenCV: custom install
wxwidgets: custom install following your directives
Build type: release
custom install directory
don't use QT
mingw generator

@Dharmesh946
Copy link
Author

Perhaps an idea: I just happen to realize that my default mingw 64 installation (from https://sourceforge.net/projects/mingw-w64/) does not properly support std::thread.
The standard headers are there so my test programs compiles but I've got a runtime error: missing entry point for thread_start.
To make my tests works I had to use https://github.com/meganz/mingw-std-threads.git and to modify c++config.h in mingw by commenting the line #define _GLIBCXX_HAS_GTHREADS 1.
Eventually, I had to do some magic in my CMakeList files to find mingw-std-threads implementation...
It's far from being straightforward.
It may be related to the the mrpt compile error (which is thread-related) but it's not clear why.
On your side, how do you make std::thread work with mingw 64?
huumm, thinking about it while writing...
SetThreadDescription is a win32 API?
my mingw 64 is posix.
I installed also a win32 but don't use it because it does not implement std::thread (if I understand correctly the comparisons I found on the net).
So
Is it possible to build MRPT with mingw-64-posix, otherwise, do you know how to use mingw-64-win32 AND having std::thread?

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants