Hopson97 / open-builder

Open "Minecraft-like" game with multiplayer support and Lua scripting support for the both client and server
https://github.com/Hopson97/open-builder/projects/3
GNU General Public License v3.0
703 stars 80 forks source link

Compile Errors #85

Closed Demomaker closed 4 years ago

Demomaker commented 4 years ago

I followed all the steps from the Building (Visual Studio) guide for Windows to be able to contribute to the project, but I still get errors while trying to compile the project.

I am getting a C1189 "#error : 'unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3)'" . The C1189 error leads to this part of the code in deps/sol.hpp : image

I am also getting a C2679 "binary '<<' : no operator found accepts a right operand of type 'std::basic_string<char,std::char_traits,std::allocator>' (or there is no acceptable conversion)". The C2679 error leads to this part of the code in deps/sol.hpp : image

I tried to follow the Building (Visual Studio) guide for Windows as closely as possible, but I'm still getting these errors. Am I missing something?

Hopson97 commented 4 years ago

Ah apolgies about this, I forgot to update the documentation after adding lua to the game.

The fix for the lua issue to add the deps/lua/ folder as an Additional Include Directory for both configurations.

As for the other error you mention with the std::cout, that should also be solved by this.

Demomaker commented 4 years ago

I added the deps/lua/ folder as an Additional Include Directory for both configurations. It solved the lua issue, but didn't solve the std::cout issue and there is now a C3779 error : "'sol::stack::stack_detail::unchecked_unqualified_get' : a function that sends 'decltype(auto)' can not be used before being defined" The error points to this in deps/sol.hpp : image

Hopson97 commented 4 years ago

You may have missed the adding C++17 , step 5.

Not sure what else would have been missed apart from this.

Demomaker commented 4 years ago

I do have the step 5 done : image (It is in french but it's basically saying ISO C++17 Standard) Although, I dont know why, the option is not present in "Configuration Properties -> General". I could only find it in "Configuration Properties -> C/C++ -> All options". I don't know if the fact that I have Visual Studio 2017 changes anything.

Demomaker commented 4 years ago

Could it be because I chose a "Visual C++" Empty project? I can't seem to find a setting for a "C/C++" Empty project.

Hopson97 commented 4 years ago

Not sure about this one, I have asked on my discord server though, so cannot help for the time being, sorry :(

Hopson97 commented 4 years ago

I mean it could be different versionings causing this.

As for the cout issue, you could double-check that #include <string> is at the top of the file, but not sure about the issue with sol

Demomaker commented 4 years ago

Adding #include at the top of the std::cout error's file did solve the std::cout issue, but the other issue is still there. Also, thank you so much for trying to help me with this.

Hopson97 commented 4 years ago

Ahh found it!

https://github.com/ThePhD/sol2/issues/830

Seems if you remove the /permissive flag (I guess visual studio 2017 adds it by default?) then it should work :)

Demomaker commented 4 years ago

Yay, it worked! Thank you so much for helping me :D. The project compiles now.

Hopson97 commented 4 years ago

Awesome! If it doesn't run, try building/running using the release configuration, as the debug one tends to be quite hit and miss.

Demomaker commented 4 years ago

It does work with release. I tried with debug, but it just shows a white screen.