Problems setting up a dev environment on Windows

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Problems setting up a dev environment on Windows

Post by AnyOldName3 »

Hi,

I'm trying to set up a dev environment on Windows 10 so I can build OpenMW (and then, if I can find an issue simple enough, actually contribute to the project while I have free time over Christmas). However, I'm at a point where it looks to me like I should be able to build the latest master-branch revision, but Visual Studio spits out a bunch of errors, both due to linking and code it can't compile in the first place. I've never directly used tools like Git or CMake, or, in fact, worked on any C/C++ code with external dependencies before, so I've been prodding at this for a few days now.

A list of what I've already done to get to where I am:
Spoiler: Show
There might be a really, really simple thing I have to do to fix this, even if it requires deleting things and starting again, but I have no idea what's actually broken, so can't make any more headway with fixing this myself.

I have received all the C/C++ teaching Cambridge University offers its Computer Science students (which is surprisingly little, but 'enough'), so I should be able to find something I can do once I have a codebase that can just be built and run, but unfortunately I'm shooting in the dark when it comes to anything that isn't actually the code itself.
User avatar
Ace (SWE)
Posts: 887
Joined: 15 Aug 2011, 14:56

Re: Problems setting up a dev environment on Windows

Post by Ace (SWE) »

You could throw the wall of errors up on pastebin, pastie.org, or another of the paste services.

I should probably write up a new guide for doing OSG, but I want to prepare a package of build dependencies in advance, including directions for building those into the guide would probably make it large enough to be worth publishing as a series of horror novels.
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Re: Problems setting up a dev environment on Windows

Post by AnyOldName3 »

Either the error list was shorter the second time I compiled it, or I panicked more than was necessary, as there are only 19 errors.
Spoiler: Show
EDIT: Actually, I remember it taking around 30 minutes to spit out errors the first time I built it, whereas this only took a few seconds, so something's definitely different this time. I'll try a build-clean to see if it changes at all.

EDIT 2: It took slightly longer to give me errors, and then didn't actually give me the same ones:
Spoiler: Show
User avatar
Ace (SWE)
Posts: 887
Joined: 15 Aug 2011, 14:56

Re: Problems setting up a dev environment on Windows

Post by Ace (SWE) »

Interesting, which branch are you trying to build? The stringops.cpp file was removed a long time ago. (here, to be exact)
Maybe try to do a clean clone, or remove it manually. But it shouldn't be there either way.

All the other errors are from it not finding the OpenAL include directory. So since I'm assuming you're using the deps retrieved from my CI script, can you check that there's an OpenAL-Soft-1.16.0.zip and that it's been extracted properly?

You should have a folder structure that looks somewhat like this;

Code: Select all

deps/
 openal-soft-1.16.0-bin/
   alsoft-config/
   bin/
   hrtf/
   hrtf_defs/
   include/
     AL/
       al.h
       alc.h
... etc
You might also want to check the cmake cache and make sure that it's been picked up correctly;
OPENAL_INCLUDE_DIR should point to the include folder (not AL, but the actual folder named include)
OPENAL_LIBRARY should point to bin/libs/Win32(Win64 if you're doing 64-bit builds)/OpenAL32.lib
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

Re: Problems setting up a dev environment on Windows

Post by lgromanowski »

@AnyOldName3: Please check if you're using https://github.com/OpenMW/openmw.git repository
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Re: Problems setting up a dev environment on Windows

Post by AnyOldName3 »

As it says within the spoiler tags in the first post, I used the repo linked to by Ace's guide (https://gist.github.com/ace13/de7f30454e99b3952405), and then manually tried to replace it with my own fork of https://github.com/OpenMW/openmw.git. That fork is up-to-date. The erroneous file got there because I don't know my way around git, so ended up copying the latest files over the older ones. If someone can give me a hint on how I clear a folder of one repository and put another there, without loosing all of CMake's output, that would be great.

As for the OpenAL issue, CMake seems to have linked everything up correctly, so I'm not sure what's going on there.

While I'm waiting on some help for how to tidy up my build environment and do things properly, I'm going to delete the file which isn't supposed to be there, and then see what happens if I compile everything again.
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Re: Problems setting up a dev environment on Windows

Post by AnyOldName3 »

Wait, I misread Ace's post. In CMake, I'm seeing this:

Image

(The include directory key links to the AL subdirectory).

I can change this, regenerate, and that issue should go away, right?

This means I've seen two issues with Ace's script, namely this being wrong, and qtbinpatcher not getting run, and I'd guess both of these would be easy fixes for someone who knew more bash than me.
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Re: Problems setting up a dev environment on Windows

Post by AnyOldName3 »

Okay, so after deleting StringOps.cpp and its header, I get 415 things failing to import that header. I'm going to look in the main repo to see if it was just the cpp that was deleted...

Update: It's compiling fine with the header returned - it's half way done, and I'm seeing no errors.
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Re: Problems setting up a dev environment on Windows

Post by AnyOldName3 »

And then pretty late in the compilation, I get this:
Spoiler: Show
User avatar
AnyOldName3
Posts: 2674
Joined: 26 Nov 2015, 03:25

Re: Problems setting up a dev environment on Windows

Post by AnyOldName3 »

So it looks to me like the next steps to fixing this would be to clean out the source code I've ended up with (either via some git command which exists, but I don't know the name or usage of, or by simply deleting the whole folder and starting again), and then after that, putting the latest code over Ace's fork without trashing the build environment it creates, which requires some git wizardry that I don't know how to do.

EDIT: Ace's script definitely sets the include directory CMake variable for OpenAL to include/AL:
Spoiler: Show
If that's not supposed to be what's happening, then it's a super simple fix.
Locked