OpMonTeam/OpMon-Archive

Compiling Instructions and Errors to fix.

PyroFlareX opened this issue · 5 comments

The compiling instructions for Windows needs a fix. I have tried both Visual Studio and Code::Blocks, and both have not been successful. Some things I found while troubleshooting:

  • Visual Studio instructions not working

  • Code::Blocks (for Windows) had to remove a bunch of the SFML related defines to avoid errors

  • SFML stuff is out of date, I am using the latest version (2.5.1) and all of the unnecessary defines are causing plenty of issues.

  • config header. This was a nightmare. Why is it in the root dir? Why is it "config.hpp.in" instead of "config.hpp"? Why is it necessary?

  • Build Errors. After doing quick fixes of the above (for the most part), there are actual building errors that aren't just misconfigurations. Settings are using c++17 with codeblocks 17.12.
    I.e. ```
    ||=== Build: Debug in OpMon (compiler: GNU GCC Compiler) ===|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\utils\misc.hpp|14|error: expected '{' before '::' token|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\utils\misc.hpp|14|error: 'Misc' in namespace '::' does not name a type|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp|35|error: 'Utils::Misc' has not been declared|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp|36|error: 'Utils::Misc' has not been declared|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp|37|error: 'Utils::Misc' has not been declared|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp|38|error: 'Utils::Misc' has not been declared|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp|39|error: 'Utils::Misc' has not been declared|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp|40|error: 'Utils::Misc' has not been declared|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp||In member function 'void Utils::OpMon::Model::OpMon::goToSleep()':|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp|128|error: 'Utils::Misc' has not been declared|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp||In member function 'void Utils::OpMon::Model::OpMon::drinkTooMuch()':|
    C:\Users\Pyros\Documents\GitHub\OpMon\src\opmon\model\objects\OpMon.hpp|134|error: 'Utils::Misc' has not been declared|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\bits\stl_raw_storage_iter.h|69|error: expected template-name before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\bits\stl_raw_storage_iter.h|69|error: expected '{' before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\bits\stl_raw_storage_iter.h|69|error: expected unqualified-id before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\typeinfo||In member function 'size_t Utils::std::type_info::hash_code() const':|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\typeinfo|144|error: '_Hash_bytes' was not declared in this scope|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\typeinfo|144|note: suggested alternative:|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\bits\hash_bytes.h|47|note: 'std::_Hash_bytes'|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\typeinfo|188|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\typeinfo|205|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\ext\concurrence.h|68|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\ext\concurrence.h|76|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\ext\concurrence.h|84|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\ext\concurrence.h|92|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|71|error: '__void_t' does not name a type|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|71|error: expected '>' before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|77|error: '__void_t' was not declared in this scope|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|77|note: suggested alternative:|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\type_traits|2407|note: 'std::__void_t'|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|77|error: template argument 2 is invalid|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|77|error: expected unqualified-id before '>' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|86|error: template argument 2 is invalid|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|184|error: template argument 1 is invalid|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|193|error: expected nested-name-specifier before 'enable_if'|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|193|error: expected initializer before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|206|error: expected nested-name-specifier before 'enable_if'|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|206|error: expected initializer before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|220|error: expected nested-name-specifier before 'enable_if'|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|220|error: expected initializer before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|271|error: '__void_t' does not name a type|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|271|error: expected '>' before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|271|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|271|error: '__void_t' was not declared in this scope|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|271|note: suggested alternative:|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\type_traits|2407|note: 'std::__void_t'|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|271|error: template argument 2 is invalid|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|271|error: expected unqualified-id before '>' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|272|error: '__void_t' does not name a type|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|272|error: expected '>' before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|272|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|272|error: '__void_t' was not declared in this scope|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|272|note: suggested alternative:|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\type_traits|2407|note: 'std::__void_t'|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|272|error: template argument 2 is invalid|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|272|error: expected unqualified-id before '>' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|273|error: '__void_t' does not name a type|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|273|error: expected '>' before '<' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|273|error: expected class-name before '{' token|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|273|error: '__void_t' was not declared in this scope|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|273|note: suggested alternative:|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\type_traits|2407|note: 'std::__void_t'|
    C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\include\c++\functional|273|error: template argument 2 is invalid|
    ||More errors follow but not being shown.|
    ||Edit the max errors limit in compiler options...|
    ||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 51 second(s)) ===|

I really don't know what all those errors are, since I have not used Code::Blocks for a while. And I don't have those build errors when I do it myself on linux with CMake. I will try to check this this week-end, if I have the time.
I have never used Visual Studio, the instructions have not been made by me, but by @Samurai413x. Maybe he can help you?
As for config.hpp, it's a CMake-related file. When CMake generates the makefile, it also generates config.hpp with the right version (#define OPMON_VERSION) and, if it's asked to CMake by the user, defines SFML_COMPATIBILITY which replaces some code to make the game compatible with SFML 2.4. So config.hpp.in is not a code file, but a template used by CMake to generate the real config.hpp file, included in the code (in src/utils/defines.hpp).

Tried it on a linux install. It works there, but still, universal build ability is important to attempt.

There aren't really any errors with the code (just the minor ones I fixed in #105), I think the main issue here is that the instructions are outdated. They should really advise using cmake like on other platforms

I'm leaving this issue open until I update the instructions. Thanks you for the pull request !

Compilation instructions are now updated.
https://github.com/OpMonTeam/OpMon/wiki/Compilation