aliens

Author Topic: Compiling instructions are inadequate for me 8[ Can anyone help me?  (Read 2520 times)

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
I tried following the instructions on:

*link removed because: "Sorry, you are not allowed to post external links."*

So I forked OXCE, pulled the sources, installed VS 2022 and opened the project in it.

Okay, obviously doesn't build yet since I need dependencies.

The wiki says:
OpenXcom requires the following libraries to compile:

SDL (libsdl1.2)
SDL_mixer (libsdl-mixer1.2)
SDL_image (libsdl-image1.2)
SDL_gfx (libsdl-gfx1.2), version 2.0.22 or later
yaml-cpp, (libyaml-cpp), version 0.5.1 (0.5.2 does not work, use latest git HEAD if you want newer version)

Now in the Wiki these are all links. Usually to some web-page. I downloaded something from the first link. It's a Zip. It contains a DLL. SDL2.dll. What do I do with that one? Do I copy that in some folder? Is this even the right one? I think the instructions could be a little clearer than just putting 5 links there.

What I also tried is to follow this link:
*link removed because: "Sorry, you are not allowed to post external links."*

It says to put stuff from the UFO-folder into the Bin-folder in my project. Done.

Then it says: "Download the following dependencies for the appropriate version of Visual Studio:"

I clicked the 2017+ link. ( *link removed because: "Sorry, you are not allowed to post external links."* )

Nothing happened.

I think I'm a reasonably decent programmer. But setting up dev-environments is something I always seem to struggle with the most.

I'd like the instructions to be more along the line of:

"These are the files you need. You have to put them in this folder on your computer. Here's an archive that contains all of them."

Does anyone feel capable to provide the instructions in a way that I might get a little further with than what's on the Wiki?

Edit: Sorry. Had to remove all links from this post.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #1 on: October 21, 2022, 08:45:14 pm »
Maybe this will help: https://openxcom.org/forum/index.php/topic,7048.0.html

First post is for Windows and VS 2022.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #2 on: October 21, 2022, 10:00:42 pm »
Maybe this will help: https://openxcom.org/forum/index.php/topic,7048.0.html

First post is for Windows and VS 2022.
Yes, this did indeed help! :)

However, I'm getting syntax-errors now for lines like this:

auto f = [&]{ return X(t); };

'&' requires l-value.

To be honest I've never seen this kind of syntax and if I was the compiler wouldn't compile it either!

Edit:

I think this might have something to do with the warning I get before, as this is in:

   static RetEnum func(ScriptWorkerBase& swb, const T* t)

And the warning is about:

"reg" not getting initialized in the construtor of ScriptWorkerBase().

But since it's working for everyone else I must be missing something here.

Edit 2: Oh, the post in the other thread mentions a workaround. That seems to be this exact issue! :o
« Last Edit: October 21, 2022, 10:30:57 pm by Xilmi »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #3 on: October 21, 2022, 11:45:51 pm »
Okay, I built it.

But what now?

I found the .exe in \OpenXcomGit\OpenXcom\bin\Win32\Release\

I figured out I had to move the dll's from \OpenXcomGit\OpenXcom\bin\Win32\ to \OpenXcomGit\OpenXcom\bin\Win32\, as it was not described to do anywhere so it starts.

But now it says: "No X-COM installations found."

But I had copied it to the folder: \OpenXcomGit\OpenXcom\bin\UFO, as the txt-file in that folder said.

I now also tried to copy it to \OpenXcomGit\OpenXcom\bin\Win32\Release\, \OpenXcomGit\OpenXcom\bin\Win32\Release\UFO, \OpenXcomGit\OpenXcom\bin\Win32\Release\data, \OpenXcomGit\OpenXcom\bin\xcom1, \OpenXcomGit\OpenXcom\bin\Win32\Release\xcom1, \OpenXcomGit\OpenXcom\bin\data...

I simply don't know where it's expecting the Game-File-Folders.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #4 on: October 21, 2022, 11:52:45 pm »
the original game resources go into: %Documents%/OpenXcom/UFO

(or many other places, but the above one is the easiest and safest)

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #5 on: October 22, 2022, 12:18:26 am »
The problem wasn't the original game-files missing it was that there was nothing under the "mods" folder.

After copying c:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\bin\standard\xcom1\ to c:\Users\ailst\OneDrive\Dokumente\OpenXcom\mods\ the error message changed.

I then copied c:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\bin\common\Language\ to c:\Users\ailst\OneDrive\Dokumente\OpenXcomGit\OpenXcom\bin\standard\xcom1\Language and this made it work.

I had to look into at code where this error-message was thrown to get clues about what exactly the problem was.

It's so weird that I had to do all copying stuff from one place to another to make it work.

My previous project had everything in the same file.

Anyways, no I can finally start coding what I want to code! :)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #6 on: October 22, 2022, 12:24:42 am »
"mods" folder can be empty... unless you want mods of course

the "common" and "standard" folders belong into the same place where the executable is... it will work if you copy them into the mods folder like you did... but that's the same as flying from London to Paris via Tokyo

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #7 on: October 22, 2022, 07:09:16 pm »
It would have been nice if VS built it in a way where all the files are at the right place.
None of the guides mentioned that I'm supposed to copy the "common" and "standard"-folders to the folder where the executable is built.

I'm also intrigued why my executable is a lot smaller than the one from the official download.

Working with Unity and Java really seem to have pussified myself! :D

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #8 on: October 22, 2022, 07:25:29 pm »
It would have been nice if VS built it in a way where all the files are at the right place.
None of the guides mentioned that I'm supposed to copy the "common" and "standard"-folders to the folder where the executable is built.

We simply don't have your use case.

If you're a player, everything is pre-packaged for you as required.

If you're a VS developer running the game directly from VS, you ALSO don't have to copy them anywhere, it's already working as is. The only thing that needs to be copied are the original game files.

Nobody uses the VS-compiled binaries for anything, see below.
For what we use officially, we have scripts that build and package everything, on all platforms. And build farms, that run the scripts after each push.

I'm also intrigued why my executable is a lot smaller than the one from the official download.

Because the official download is not built with VS.
It's bigger because all DLL files are "inside" the exectable.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #9 on: October 22, 2022, 09:23:05 pm »
"If you're a VS developer running the game directly from VS"

This is what I had hoped to be able to do but I've not seen the option.  :o
I've worked with VS before and I thought there was a build&run hotkey but I'm not seeing it here.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8631
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #10 on: October 22, 2022, 09:32:52 pm »
It's the one highlighted in red on the attached screenshot.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 605
    • View Profile
Re: Compiling instructions are inadequate for me 8[ Can anyone help me?
« Reply #11 on: October 22, 2022, 09:36:01 pm »
Thanks! :)
This should streamline my work tremendously! :D