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

Fail to compile the source files on Windows11 #127

Open
topfyf opened this issue Oct 5, 2023 · 0 comments
Open

Fail to compile the source files on Windows11 #127

topfyf opened this issue Oct 5, 2023 · 0 comments

Comments

@topfyf
Copy link

topfyf commented Oct 5, 2023

I downloaded the headers of boost1.83.0 under Windows11, and failed to compile the files in src/.

I used MinGW and the Makefile Makefile_mingw to build, and got the error outputs:

System.cpp: In member function 'int System::RunThreadsSTL()':
System.cpp:463:10: error: 'thread' was not declared in this scope
   vector<thread *> threads;
          ^~~~~~
System.cpp:463:10: note: suggested alternatives:
In file included from C:\boost_1_83_0/boost/thread/thread_only.hpp:22:0,
                 from C:\boost_1_83_0/boost/thread/thread.hpp:12,
                 from C:\boost_1_83_0/boost/thread.hpp:13,
                 from parallel.h:21,
                 from System.cpp:19:
C:\boost_1_83_0/boost/thread/detail/thread.hpp:163:29: note:   'boost::thread'
     class BOOST_THREAD_DECL thread
                             ^~~~~~
In file included from C:\boost_1_83_0/boost/thread.hpp:19:0,
                 from parallel.h:21,
                 from System.cpp:19:
C:\boost_1_83_0/boost/thread/tss.hpp:18:19: note:   'boost::detail::thread'
         namespace thread
                   ^~~~~~
System.cpp:463:18: error: template argument 1 is invalid
   vector<thread *> threads;
                  ^
System.cpp:463:18: error: template argument 2 is invalid
System.cpp:470:11: error: request for member 'resize' in 'threads', which is of non-class type 'int'
   threads.resize(nu);
           ^~~~~~
System.cpp:473:14: error: invalid types 'int[unsigned int]' for array subscript
     threads[k] = new thread(fptr, k);
              ^
System.cpp:473:22: error: expected type-specifier before 'thread'
     threads[k] = new thread(fptr, k);
                      ^~~~~~
System.cpp:477:14: error: invalid types 'int[unsigned int]' for array subscript
     threads[k]->join();
              ^
System.cpp:478:21: error: invalid types 'int[unsigned int]' for array subscript
     delete threads[k];
                     ^
Makefile:94: recipe for target 'System.o' failed
make: *** [System.o] Error 1

Did I do anything wrong?

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

1 participant