Compiled windows x64 build, crashes on launch. Any tips on solving this?

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Post Reply
mattwla
Posts: 59
Joined: 17 Jul 2017, 14:45

Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by mattwla »

Here is a screenshot of what happens, is there a crash log I could find to gleam some info?

http://imgur.com/a/pe4ly

Thanks,
mattwla
Posts: 59
Joined: 17 Jul 2017, 14:45

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by mattwla »

So, an update:

I copied all the dll files from a known working openmw and it worked. But now the launcher exe doesn't work, and shoots this error message

http://imgur.com/a/qarGP

this was preventing me from setting proper load order, and when I worked around it to launch openmw exe again I am greeting with this:

http://imgur.com/a/brjvN

Cmake worked fine, and I compiled fine.... but it seems like my dependencies are flawed. Where could things have gone wrong? Should I start from scratch? I used this to build dependencies: https://gist.github.com/ace13/de7f30454e99b3952405 and pulled the latest GitHub source code for OpenMW.

Thanks,
mattwla
Posts: 59
Joined: 17 Jul 2017, 14:45

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by mattwla »

Wow I think I got it.

For those who end up here trying to sort out similar issues: Here is all the stuff I did, I did not go about it scientifically so I am not sure which steps are key and which were pointless.

I deleted all my build stuff, starting from scratch.
I ran cmake again, this time I set BUILD_TYPE to release and made sure QT_QTMAKE_EXECUTABLE was filled in (before it was empty, although it compiled fine)
Built everything in visual studio
Deleted old user configs in my documents
tried to run openmw, it complained about missing dlls
Found all missing dlls by searching the dependencies I downloaded through the windows auto dependency getter script linked above
After all of that.... mygui was missing files!
So I copeid the resources/mygui from a working public openmw release into my built openmw folder, than over wrote thaqt with the resources/mygui found in my built openmw
And now it works.

Yay.

I'm sure I am taking the hard way here, and if anyone knowledgable could help me see why I am stumbling I would appreciate it!

Thanks
User avatar
AnyOldName3
Posts: 2667
Joined: 26 Nov 2015, 03:25

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by AnyOldName3 »

When I run the CI script, it puts all the DLLs and resource files in the same directories as the executables. In fact, I even wrote part of the script concerned with this task. Everything should 'just work'. However, if you want to run anything via Visual Studio's debugger, you'll need to go into the project properties, then into the debugging section, and change the working directory from $(ProjectDir) to $(TargetDir), as to my knowledge, there's no way we could easily change that from the script automatically.
mattwla
Posts: 59
Joined: 17 Jul 2017, 14:45

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by mattwla »

Thanks for the info and thanks for your work on the script,

The script might not have executed properly on my machines. On both computers I have built OpenMW on, I had to manually add the PATH environment variables for cmake to find the dependencies, which I think the script is supposed to do.

Any idea what could have gone wrong on my end? The script didn't flash any errors while running.
User avatar
AnyOldName3
Posts: 2667
Joined: 26 Nov 2015, 03:25

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by AnyOldName3 »

If you had to manually meddle with cmake, then the script didn't run properly. What arguments did you call it with, and did you definitely run it through Git Bash rather than something like Cygwin or Windows Subsystem for Linux?
mattwla
Posts: 59
Joined: 17 Jul 2017, 14:45

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by mattwla »

I right clicked in the repo I cloned and choose the git bash option, than copied and pasted the command line in the tutorial (I had the same visual studio and the same windows edition).

Does the script require any user input? I don't recall having to move it along at all. I was away from the computer when it ran both times and came back to a flashing command prompt.

Also, while I have your attention. What is the best way to get everything organized in visual studio to work on OpenMW. When I open the OpenMW solution, there is a neat file tree which helps, but there is a lot of stuff in there I don't need.

Is there a simple way to load the OpenMW repo I downloaded into Visual Studio? Would I need to run CMake again after editing the repo clone?

Thanks,
User avatar
AnyOldName3
Posts: 2667
Joined: 26 Nov 2015, 03:25

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by AnyOldName3 »

What I do that seems to always work on a new machine:
  1. clone the repo
  2. open git bash in the repo
  3. run these two commands:

    Code: Select all

    CI/before_script.msvc.sh -k -v 2015 -c Release -p Win64
    CI/before_script.msvc.sh -k -v 2015 -c Debug -p Win64
  4. Go into the build folder
  5. Open the OpenMW.sln solution file
  6. Right click on each of the projects which spit out an executable (e.g. openmw, openmw-cs, openmw-launcher etc.) to open the properties dialogue, then go to the debug section, and change the working directory from $(ProjectDir) to $(TargetDir)
At this point, everything should build just fine and run just fine, either by going and finding the application and double clicking it or by launching it through Visual Studio's debugger. If you change any code and rebuild, then it should 'just work' (unless the changes you made actually broke something :P ).

If you add any files to the project, though, you'll need to reference the additional files in the relevant CMakeLists.txt file, and then potentially run CMake again (which is most easily done by running the two build script commands again). If you pull upstream changes and any new files have been added, that'll also mean CMake needs to be run again.

As for getting things organised within Visual Studio, I just kind of dealt with it as things are spat out by the build script. Figuring out which file you actually need to look at can be a pain, but often just asking someone who's worked on a related feature can yield the answer pretty quickly.

As for why you've had problems, I'm guessing you might have been making release builds when you've only actually run the script in Debug mode (if you don't use the -c switch to specify Debug or Release, it defaults to Debug, and doesn't put the resource files where the Release builds can see them). Using CMake to manually generate the Release configuration doesn't fix this.
mattwla
Posts: 59
Joined: 17 Jul 2017, 14:45

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by mattwla »

This is some great info, thanks so much. I think you are probably right regarding the issues stemming from building release instead of debug versions.

What advantage does the debug version offer? More feedback about runtime stuff?

Thanks again, this info is really helping me get on track.
User avatar
AnyOldName3
Posts: 2667
Joined: 26 Nov 2015, 03:25

Re: Compiled windows x64 build, crashes on launch. Any tips on solving this?

Post by AnyOldName3 »

Debug builds are significantly slower, but you gain the abilities like breakpoints to pause execution at a specific line and to step through line by line, observing how the values of variables change. When something doesn't work and you don't know why, or does work, and you don't know why, this is obviously really helpful.
Post Reply