schombert / Open-V2

GNU General Public License v3.0
118 stars 28 forks source link

Compile #12

Open TheSurmin opened 3 years ago

TheSurmin commented 3 years ago

Can ya do a tutorial or at least give a few advices for compiling? I`ll think bout adding more content from hpm if i can run it.

schombert commented 3 years ago

Here is the chat log of me helping someone else build the project; maybe this will help you

Feb 26 Other participant 3:14 AM

Which file is the hard coded paths to go to Victoria 2.

Other participant 3:21 AM

Or which lines since I found a few places where file_explorer.cpp can not open source file such as #include

schombert 3:30 AM

If you can't find windows.h then your compiler environment isn't set up correctly, since that is a standard windows header (you are building under windows right?)

Do you not have the windows sdk installed?

Other participant 4:07 AM

sorry probably not lost when my pc reset

Other participant 5:53 AM

Okay I install the SDK and do missing files popped up.

Other participant 6:38 AM

Whenever I do "local windows debugging" an error pops up saying that it can't find the path.

Other participant 7:06 AM

auto adj_map = provinces::generate_map_adjacencies(s1.province_m.province_map_data.data(), s1.province_m.province_map_height, s1.province_m.province_map_width);

it says this is missing

or can't open rather

schombert 1:49 PM

Make sure that you have adjusted the paths found in main to where your Victoria 2 installation actually lives and to a directory that can hold the new save files that will be created. Make sure that you have copied the mod files from the GitHub repository into the actual mod directory

And, most importantly, you need to tell me the exact text of the error messages so that I can determine what is actually happening.

Feb 27 Other participant 3:36 AM

Sorry I just do not know where to locate where the "main" is it might be I am currently thinking that it is int main(int , char **) I probably am wrong could you specify where main is.

schombert 3:50 AM

Yes, that is main

Other participant 5:56 AM

fs.set_root(u"D:\programs\V2"); fs.add_root(u"D:\programs\V2\mod\OpenV2");

this what I change or no

schombert 1:39 PM

yes and the paths on lines 226, 253, 263, 270, 336, and 340

Other participant 2:48 PM

It says: Unable to start program 'C:\Users\xxxxx\Documents\GitHub\Open-V2..\open_v2_test_data\Debug\Open V2.exe'.

The system cannot find the file specified.

schombert 3:28 PM

So this is a problem with your IDE configuration, your debugger isn't looking where the compiled program was created. You need to figure out where the output directory for the compiler is (i.e. where the created .exe is) and point the debugger at it.

schombert 3:35 PM

here is the help pages for project properties: https://docs.microsoft.com/en-us/cpp/build/reference/property-pages-visual-cpp?view=msvc-160

Other participant 4:08 PM

I am supposed to put the full directory, folder name, or something else.

schombert 4:17 PM

You could set it back to the default, namely $(SolutionDir)$(Configuration), or your could set it to any directory you want. Documentation on the macros is found here: https://docs.microsoft.com/en-us/cpp/build/reference/common-macros-for-build-commands-and-properties?view=msvc-160

Other participant 4:25 PM

I tried using $(SolutionDir)$(Configuration) but it gives the same error unless there is somewhere else I would have to change it sorry if this is annoying.

schombert 4:30 PM

Did the build complete successfully? Is the file actually in the specified location?

Other participant 4:44 PM

hmm From what I can tell the build failed saying that it cannot open source file for these 4

include "boost\container\flat_map.hpp"

include "boost\container\small_vector.hpp"

include "boost\container\flat_set.hpp"

include "boost\date_time\gregorian\gregorian_types.hpp"

schombert 4:47 PM

then you need to install boost https://www.boost.org/ and then point the additional include directories property at it

Other participant 11:53 PM

It now says that it cannot open 'Debug\commands.lib'

Feb 28 schombert 12:12 AM

and was commands.lib, generated by the commands project, built there?

Other participant 1:49 AM

It was not generated unless one of the 3 exes found in Debug could make it.

schombert 1:59 AM

So you need to find why that project failed to build or where it ended up

Other participant 2:29 AM

Every time I test it it says it succeeds but I don't know where it went.

schombert 2:38 AM

So find what the output directory is in its project settings, and see if it went there. If it is ending up in the wrong place, change the output directory to where it should end up and rebuild it.

Other participant 2:52 AM

Nevermind it is still failing on commands.lib and would you know where it is defined since when I search for it in file_explorer.cpp there is nothing.

Would that mean I am missing a file, extension or program

schombert 2:59 AM

commands.lib is the file generated by the commands project. ach of the projects in the solution generates some sort of output.

The file explorer project is looking for it because it is one of the things listed in its references

Other participant 3:14 AM

okay it seems like EIGEN_LAPACKE_EIG_SELFADJ is making an error in commands project

schombert 3:23 AM

I'm going to need the actual error message

Other participant 3:59 AM

Okay for when I run local windows debugger: Unable to start program 'C:\Users\xxxxx\Documents\GitHub\Open-V2..\open_v2_test_data\Debug\Open V2.exe'.

The system cannot find the file specified. and for build it cannot open 'Debug\commands.lib' and what was just saying for commands "guiddef.h" cannot be opened

schombert 4:08 AM

The error message I need is the one that appears in the output panel explaining why the commands project fails to build

Other participant 4:28 AM

Okay I think the issue was that I did not set boost to all project folders

Other participant 6:53 AM

It did fix the cannot open 'Debug\commands.lib' but now for whatever reason, it stops at economy.lib and it gives me the error MSB6006 "cmd" exited with code 3.

schombert 2:25 PM

Look (in windows explorer) in the top level directory for the project (the one containing the Open V2.sln file). There should be a directory called "bin". If there is not, create a new folder and call it "bin". Inside bin should be three files: "container_generator.exe", "gui_window_generator.exe", and "parser_generator.exe". These are each generated by the projects of the same name. So if they are missing, build those three projects and then move the files into the bin directory.

Other participant 4:45 PM

Okay, I think I am close but Visual Studios freezes my computer every time I build.

schombert 5:03 PM

If nothing actually crashes then you may just need to give it more time. You can also try building the little pieces first to reduce the load. If your computer is physically locking up that sounds like a computer hardware problem.

Other participant 11:32 PM

Okay, I got it working now but what program did you use for graphics, since it is cannot open the file 'ft2build.h'

schombert 11:40 PM

that is one of the freetype headers (https://www.freetype.org/) which you will need to download and then point the additional includes property of the graphics project to. You will also need to make sure you have version 2.8.1 if you want to use the .lib that I put into GitHub, otherwise you will also need to build freetype.

Mar 1 Other participant 12:15 AM

Where on GitHub would the .lib be also just realized I already had freetype.

schombert 12:25 AM

in the "lib" directory

Other participant 12:49 AM

Oh sorry, do I put the respective files in the freetype folder

schombert 12:54 AM

leave the .lib where it is, and put the freetype folder wherever you want, as long as you point the graphics project at its include directory

Other participant 1:41 AM

Whenever I try setting the additional directories it still does not recognize ft2build.h

schombert 1:44 AM

Is ft2build.h located in the directory you added to Configurations Settings : C/C++ : Additional Include Directories ?