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

ECST does not compile (gcc or clang) on Windows, issue is either with boost::hana or ECST itself. #33

Closed
anonanon17 opened this issue Nov 20, 2017 · 8 comments

Comments

@anonanon17
Copy link

anonanon17 commented Nov 20, 2017

After a lot of struggling I managed to figure out how to build ecst on Windows using MinGW. I've build the header library but I don't see any .dll or similar file that I could include in my project.

I'm trying to compile into a format I can just use with Visual Studio, since my main project is already setup in there and I don't want to have to rewrite all my platform specific code to work with MinGW. I know you can't compile ecst with VC, but can I compile it with MinGW into a dll or whatever then use it in a Visual Studio project?

I'm very new to CMake etc... so maybe I'm missing something embarrassingly obvious. I'm a mathematician (not a computer scientist) so I'm not 100% up to date with all this (I assume really useful) technology. So I guess what I'm asking is, is there any way I can compile ecst and then use it in another project or do I have to compile ecst with my project each time (and thus forcing me to not use Visual Studio)?

I'm so confused, every other header-only library I have used is just a .dll, a .lib and a bunch of header files. When I generate with MinGW I don't get any of these things. Just a file named "a.exe" that doesn't appear to do anything. Note that I commented out the examples on the makefile as I don't have SFML installed (I'm use SDL). Reading my post through, I think I must be missing something obvious - apologies if this post is a waste of everyone's time.

Thanks!

@OvermindDL1
Copy link

I'm so confused, every other header-only library I have used is just a .dll, a .lib and a bunch of header files.

Well first of all if a library is 'header-only' then it, by definition, would not have any .dll/.lib/.a/whatever other files, only *.h/*.hpp. ^.^

Same with this library, you only need to include the include directories and 'use' them in your project.

I've not tried it in VC (I'm a linux user myself) but I'd imagine the parts of the source that do not work are probably just some GCC intrinsics or some #ifdef's or something that you could fix yourself and PR the fixes back here. :-)

You'd start by just making your project in VC, then just linking in the headers from this project, then find what does not compile as you try to use it and fix it (and PR the fixes back), and repeat. :-)

@anonanon17
Copy link
Author

Ah okay, well it seems from this #29 that it will be easiest to just use a g++ or clang compiler instead - I may try Visual Studio with g++ or clang dropped in as the compiler, I'll report back with results.

@anonanon17
Copy link
Author

anonanon17 commented Nov 23, 2017

Update:

Visual Studio g++ was incredibly unfriendly so I've switched to Code::Blocks using MinGW gcc as the compiler.

Unfortunately, after linking boost, ecst, vrm_core and vrm_pp I get some errors in the ecst code that I believe may be actual errors and not just linking issues. Do you have any ideas?

EDIT: I believe this is an issue with my MinGW installation - I think I have the Win32 threads rather than Posix threads, I will report back when I try Posix shortly.

EDIT 2: Made sure I'm using Posix, but still get the same errors. I'm very confused at the moment.

EDIT 3: Turns out the "standard" MinGW installation does not support Posix (or if it does, not easily). I installed MinGW-w64 and got a little bit further, see the below post.

||=== Build: Debug in ECST_Test (compiler: GNU GCC Compiler) ===|
c:\clib\ecst\include\ecst\aliases\threading\std.hpp|50|error: 'this_thread' is not a namespace-name|
c:\clib\ecst\include\ecst\aliases\threading\std.hpp|50|error: expected namespace-name before ';' token|
c:\clib\ecst\include\ecst\aliases\threading\std.hpp|52|error: 'std::thread' has not been declared|
c:\clib\ecst\include\ecst\aliases\threading\std.hpp|53|error: 'std::mutex' has not been declared|
c:\clib\ecst\include\ecst\aliases\threading\std.hpp|55|error: 'std::condition_variable' has not been declared|
c:\clib\ecst\include\ecst\mp\list\basic.hpp||In function 'constexpr auto ecst::mp::list::index_of(TList&&, T&&)':|
c:\clib\ecst\include\ecst\mp\list\basic.hpp|31|error: 'make_pack' in namespace 'boost::hana::detail' does not name a template type|
c:\clib\ecst\include\ecst\mp\list\basic.hpp|32|error: 'Pack' was not declared in this scope|
c:\clib\ecst\include\ecst\mp\list\basic.hpp|32|error: template argument 2 is invalid|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|17|error: 'mutex' in namespace 'ecst' does not name a type|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|18|error: 'condition_variable' in namespace 'ecst' does not name a type|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|19|error: 'mutex_type' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|19|error: template argument 1 is invalid|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|20|error: 'mutex_type' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|20|error: template argument 1 is invalid|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: variable or field 'access_cv_counter' declared void|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: 'mutex_type' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: 'mutex' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: 'cv_type' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: 'cv' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: expected primary-expression before '&' token|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: 'c' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: expected primary-expression before '&&' token|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|31|error: 'f' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: variable or field 'decrement_cv_counter_then' declared void|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: 'mutex_type' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: 'mutex' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: 'cv_type' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: 'cv' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: expected primary-expression before '&' token|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: 'c' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: expected primary-expression before '&&' token|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|43|error: 'f' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|55|error: variable or field 'decrement_cv_counter_and_notify_one' declared void|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|55|error: 'mutex_type' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|55|error: 'mutex' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|55|error: 'cv_type' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|55|error: 'cv' was not declared in this scope|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|55|error: expected primary-expression before '&' token|
c:\clib\ecst\include\ecst\utils\cv_operations\cv_operations.hpp|55|error: 'c' was not declared in this scope|
c:\clib\ecst\include\ecst\thread_pool\third_party\concurrent_queue\concurrentqueue.h|51|error: expected '}' before end of line|
c:\clib\ecst\include\ecst\thread_pool\third_party\concurrent_queue\concurrentqueue.h|51|error: expected '}' before end of line|
c:\clib\ecst\include\ecst\thread_pool\third_party\concurrent_queue\concurrentqueue.h|51|error: expected declaration before end of line|
||=== Build failed: 42 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

@anonanon17
Copy link
Author

anonanon17 commented Nov 23, 2017

Update 2:

Uninstalled MinGW, and installed MinGW-w64 (which supports Posix properly). I now get the following errors:

EDIT: I have looked through every single issue, and the only hope seems to be using nuwen MinGW #15, although this is just a package containing the latest boost and MinGW-w64 so I can't see why this would make a difference. I will update when I have tried again.

EDIT 2: So I uninstalled MinGW-w64 and installed nuwen MinGW. I get exactly the same errors upon building, which makes me believe this is an error with ECST itself as the creator mentions using nuwen MinGW to successfully build ECST in #15 .

At this point I believe it is probably best for me to abandon hope of using ECST and roll my own solution. If anyone does have a solution to the compilation issues I'm facing that would be great.

EDIT 3: In case anyone is reading this in the future, these are the steps I took that did not work:

1 - Clone ECST repo.
2 - Run setup .sh script.
3 - Install Code::Blocks and nuwen MinGW using this tutorial: https://solarianprogrammer.com/2017/11/22/install-codeblocks-gcc-windows/
4 - Check the gcc compiler is working fine (it was).
5 - Create a new console project.
6 - Insert the "code sample" code from the repo.
7 - Link the ecst, vrm_core, vrm_pp and boost libraries.
8 - Build.

I get exactly the same errors (below) that I got with any other MinGW installation. I can only conclude there is an issue with ECST, or some magic trick that will get it working. Either way, I unfortunately do not have time to mess around with this any longer.

||=== Build: Debug in ECST_Test (compiler: GNU GCC Compiler (x64)) ===| C:\CLib\ecst\include\ecst\mp\list\basic.hpp||In function 'constexpr auto ecst::mp::list::index_of(TList&&, T&&)':| C:\CLib\ecst\include\ecst\mp\list\basic.hpp|31|error: 'make_pack' in namespace 'boost::hana::detail' does not name a template type| C:\CLib\ecst\include\ecst\mp\list\basic.hpp|32|error: 'Pack' was not declared in this scope| C:\CLib\ecst\include\ecst\mp\list\basic.hpp|32|error: template argument 2 is invalid| C:\CLib\Test\ECST_Test\main.cpp|12|error: 'vec2f' does not name a type| C:\CLib\Test\ECST_Test\main.cpp|17|error: 'vec2f' does not name a type| C:\CLib\Test\ECST_Test\main.cpp|22|error: 'vec2f' does not name a type| C:\CLib\Test\ECST_Test\main.cpp|56|error: 'ft' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|75|error: 'ft' has not been declared| C:\CLib\Test\ECST_Test\main.cpp||In function 'constexpr auto ecst_setup::make_ssl()':| C:\CLib\Test\ECST_Test\main.cpp|140|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|148|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|150|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|161|error: 'vec2f' does not name a type| C:\CLib\Test\ECST_Test\main.cpp||In function 'auto mk_particle(TProxy&, const int&)':| C:\CLib\Test\ECST_Test\main.cpp|169|error: there are no arguments to 'rndvec2f' that depend on a template parameter, so a declaration of 'rndvec2f' must be available [-fpermissive]| C:\CLib\Test\ECST_Test\main.cpp|169|note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)| C:\CLib\Test\ECST_Test\main.cpp||In function 'int main()':| C:\CLib\Test\ECST_Test\main.cpp|189|error: invalid use of void expression| C:\CLib\Test\ECST_Test\main.cpp|198|error: 'sz_t' was not declared in this scope| C:\CLib\Test\ECST_Test\main.cpp|198|note: suggested alternatives:| ..\..\ecst\extlibs\vrm_core\include\vrm\core\type_aliases\numerical.hpp|24|note: 'vrm::core::sz_t'| ..\..\ecst\extlibs\vrm_core\include\vrm\core\type_aliases\numerical.hpp|24|note: 'vrm::core::sz_t'| ..\..\ecst\extlibs\vrm_core\include\vrm\core\type_aliases\numerical.hpp|24|note: 'vrm::core::sz_t'| ..\..\ecst\extlibs\vrm_core\include\vrm\core\type_aliases\numerical.hpp|24|note: 'vrm::core::sz_t'| ..\..\ecst\extlibs\vrm_core\include\vrm\core\type_aliases\numerical.hpp|24|note: 'vrm::core::sz_t'| C:\CLib\Test\ECST_Test\main.cpp|198|error: 'i' was not declared in this scope| C:\CLib\Test\ECST_Test\main.cpp|200|error: there are no arguments to 'random_position' that depend on a template parameter, so a declaration of 'random_position' must be available [-fpermissive]| C:\CLib\Test\ECST_Test\main.cpp||In function 'int main()':| C:\CLib\Test\ECST_Test\main.cpp|207|error: 'delta_time' was not declared in this scope| C:\CLib\Test\ECST_Test\main.cpp|207|note: suggested alternative: 'localtime'| C:\CLib\Test\ECST_Test\main.cpp|212|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|214|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|214|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|214|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|216|error: 'dt' is not captured| C:\CLib\Test\ECST_Test\main.cpp|209|note: the lambda has no capture-default| C:\CLib\Test\ECST_Test\main.cpp|207|note: '<typeprefixerror>dt' declared here| C:\CLib\Test\ECST_Test\main.cpp|218|error: 'dt' is not captured| C:\CLib\Test\ECST_Test\main.cpp|216|note: the lambda has no capture-default| C:\CLib\Test\ECST_Test\main.cpp|207|note: '<typeprefixerror>dt' declared here| C:\CLib\Test\ECST_Test\main.cpp|223|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|224|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|224|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|225|error: 'dt' is not captured| C:\CLib\Test\ECST_Test\main.cpp|209|note: the lambda has no capture-default| C:\CLib\Test\ECST_Test\main.cpp|207|note: '<typeprefixerror>dt' declared here| C:\CLib\Test\ECST_Test\main.cpp|227|error: 'dt' is not captured| C:\CLib\Test\ECST_Test\main.cpp|225|note: the lambda has no capture-default| C:\CLib\Test\ECST_Test\main.cpp|207|note: '<typeprefixerror>dt' declared here| C:\CLib\Test\ECST_Test\main.cpp|229|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|230|error: 'dt' is not captured| C:\CLib\Test\ECST_Test\main.cpp|209|note: the lambda has no capture-default| C:\CLib\Test\ECST_Test\main.cpp|207|note: '<typeprefixerror>dt' declared here| C:\CLib\Test\ECST_Test\main.cpp|236|error: there are no arguments to 'do_something_before' that depend on a template parameter, so a declaration of 'do_something_before' must be available [-fpermissive]| C:\CLib\Test\ECST_Test\main.cpp|238|error: 'dt' is not captured| C:\CLib\Test\ECST_Test\main.cpp|230|note: the lambda has no capture-default| C:\CLib\Test\ECST_Test\main.cpp|207|note: '<typeprefixerror>dt' declared here| C:\CLib\Test\ECST_Test\main.cpp|240|error: 'dt' is not captured| C:\CLib\Test\ECST_Test\main.cpp|238|note: the lambda has no capture-default| C:\CLib\Test\ECST_Test\main.cpp|207|note: '<typeprefixerror>dt' declared here| C:\CLib\Test\ECST_Test\main.cpp|243|error: there are no arguments to 'do_something_after' that depend on a template parameter, so a declaration of 'do_something_after' must be available [-fpermissive]| C:\CLib\Test\ECST_Test\main.cpp||In function 'int main()':| C:\CLib\Test\ECST_Test\main.cpp|248|error: 'st' has not been declared| C:\CLib\Test\ECST_Test\main.cpp|251|error: there are no arguments to 'log' that depend on a template parameter, so a declaration of 'log' must be available [-fpermissive]| C:\CLib\Test\ECST_Test\main.cpp|253|error: expected unqualified-id before '}' token| C:\CLib\Test\ECST_Test\main.cpp|253|error: expected ';' before '}' token| C:\CLib\Test\ECST_Test\main.cpp|256|error: there are no arguments to 'log' that depend on a template parameter, so a declaration of 'log' must be available [-fpermissive]| C:\CLib\Test\ECST_Test\main.cpp|257|error: expected unqualified-id before '}' token| C:\CLib\Test\ECST_Test\main.cpp|257|error: expected ';' before '}' token| C:\CLib\Test\ECST_Test\main.cpp||In instantiation of 'main()::<lambda(auto:143)> [with auto:143 = ecst::entity_id]':| C:\CLib\ecst\include\ecst\context\data\data\refresh_event\refresh_event.inl|46|required from 'struct ecst::refresh_event::on_reclaim(TF&&) [with TF = main()::<lambda(auto:143)>]::<lambda>'| C:\CLib\ecst\include\ecst\context\data\data\refresh_event\refresh_event.inl|49|required from 'auto ecst::refresh_event::on_reclaim(TF&&) [with TF = main()::<lambda(auto:143)>]'| C:\CLib\Test\ECST_Test\main.cpp|257|required from here| C:\CLib\Test\ECST_Test\main.cpp|256|error: 'log' was not declared in this scope| C:\CLib\Test\ECST_Test\main.cpp|256|note: suggested alternative:| C:\CLib\ecst\include\ecst\debug\log\impl.hpp|81|note: 'ecst::debug::impl::log'| ||=== Build failed: 43 error(s), 4 warning(s) (0 minute(s), 2 second(s)) ===|

@anonanon17
Copy link
Author

anonanon17 commented Nov 23, 2017

Just for "fun", I tried compiling with Clang. I got essentially the exact same issue, so I'm now almost certain either boost::hana or ECST is broken.

||=== Build: Debug in BasicCompilerTest (compiler: LLVM Clang Compiler) ===| C:\CLib\ecst\include\ecst\mp\.\list\basic.hpp|31|error: no type named 'make_pack' in namespace 'boost::hana::detail'| C:\CLib\ecst\include\ecst\mp\.\list\basic.hpp|31|error: expected ';' after alias declaration| C:\CLib\ecst\include\ecst\mp\.\list\basic.hpp|32|error: use of undeclared identifier 'Pack'| C:\CLib\ecst\include\ecst\mp\.\list\basic.hpp|32|error: no type named 'value' in the global namespace| C:\CLib\Test\BasicCompilerTest\main.cpp|12|error: unknown type name 'vec2f'| C:\CLib\Test\BasicCompilerTest\main.cpp|17|error: unknown type name 'vec2f'| C:\CLib\Test\BasicCompilerTest\main.cpp|22|error: unknown type name 'vec2f'| C:\CLib\Test\BasicCompilerTest\main.cpp|56|error: unknown type name 'ft'| C:\CLib\Test\BasicCompilerTest\main.cpp|75|error: unknown type name 'ft'| C:\CLib\Test\BasicCompilerTest\main.cpp|140|error: use of undeclared identifier 'st'| C:\CLib\Test\BasicCompilerTest\main.cpp|148|error: use of undeclared identifier 'st'| C:\CLib\Test\BasicCompilerTest\main.cpp|150|error: use of undeclared identifier 'st'| C:\CLib\Test\BasicCompilerTest\main.cpp|139|error: variables defined in a constexpr function must be initialized| C:\CLib\Test\BasicCompilerTest\main.cpp|161|error: unknown type name 'vec2f'| C:\CLib\Test\BasicCompilerTest\main.cpp|198|error: unknown type name 'sz_t'| C:\CLib\Test\BasicCompilerTest\main.cpp|207|error: use of undeclared identifier 'delta_time'| C:\CLib\Test\BasicCompilerTest\main.cpp|212|error: use of undeclared identifier 'st'| C:\CLib\Test\BasicCompilerTest\main.cpp|214|error: use of undeclared identifier 'st'| C:\CLib\Test\BasicCompilerTest\main.cpp|214|error: use of undeclared identifier 'st'| ||error: too many errors emitted, stopping now [-ferror-limit=]| ||=== Build failed: 20 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|

@anonanon17 anonanon17 changed the title How do I use ecst in my project after building? ECST does not compile (gcc or clang) on Windows, issue is either with boost::hana or ECST itself. Nov 23, 2017
@vittorioromeo
Copy link
Owner

@anonanon17: this is an ecst bug, not related to Windows. I will fix it ASAP.

@vittorioromeo
Copy link
Owner

@anonanon17 : Let me know if 30cfe09 fixed your build issue.

BTW, if you need a Windows implementation of std::thread, check out:
https://github.com/meganz/mingw-std-threads

@anonanon17
Copy link
Author

anonanon17 commented Nov 24, 2017

Appears to have fixed the issue, thanks! I used gcc to compile (via nuwen MinGW) and I will try a clang build later.

I'm going to go through making a basic setup using your thesis as a guide, and I'll let you know if I encounter any problems. I'm fairly certain the original issue is fixed.

Will also check out that std::thread implementation, thanks.

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

3 participants