Building for Windows in 2021

Started by Monsieur OUXX, Thu 02/09/2021 18:18:51

Previous topic - Next topic

Monsieur OUXX

I want to build the SDL2 branch of the Engine on Windows 10.

I'm following those instructions : https://github.com/adventuregamestudio/ags/blob/master/Windows/README.md

Here is what I've tried :

1. Open Visual Studio 2019
2. Clone repository : https://github.com/adventuregamestudio/ags.git
3. VS asks me if I want to convert the project to VS2019. I say yes.
4. Switch to branch ags3--sdl2
4. Open solution 'Engine'
5. Download SDL2 from https://www.libsdl.org/download-2.0.php ( SDL2-2.0.16-win32-x86.zip ) , unzip it to a random folder
6. In project Engine.App, set the path to SDL2's include folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php
7. In project Engine.App, set the path to SDL2's lib folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php
8. Download glext.h from here ( https://www.khronos.org/registry/OpenGL/api/GL/glext.h ) and put it in SDL's include folder for convenience. EDIT: I don't know if it's still needed
9. Download SDL_sound from here ( https://hg.icculus.org/icculus/SDL_sound/archive/997e90562b35.tar.gz ). Unzipped it to a random folder. In project Engine.App, set up the path to SDL_Sound's include folder.


Clean the solution , rebuild the solution.

No compilation error, but linking error : SDL_sound.lib cannot be found.
It's not in the prebuilt package : https://www.dropbox.com/s/3vdq7qw01tdtfux/ags-prebuilt-libs-3.5.x.zip?dl=0

How do I get SDL_sound.lib ?
In the past I've built it myself but I cried so many tears of blood trying to download the dependency of the dependency of the dependency for whatever many libs that I'm not doing it again.
 

Monsieur OUXX

Despite the end of my post, "just suck it up and build the library yourself" is an acceptable answer. I just want to be sure that it's not just lying around somewhere.
 

eri0o

I don't know what you are doing or want to do, but, some observations:


  • master branch is ags3 with sdl2 backend
  • latest release of master branch includes a zip file with Windows Visual Studio project Dependencies pre-built
  • If you don't use VS, but you have it installed, you can also just use CLion and it will magically download and prebuild all dependencies - again, for VS pre-built everything is on GH release if you need

Right, we also have environment variables you can set (for your user on Windows) to point where the pre-built of each library is in your system.

Crimson Wizard

#3
Quote from: Monsieur OUXX on Thu 02/09/2021 18:18:51
4. Switch to branch ags3--sdl2

"ags3--sdl2" was a temporary branch where we prepared SDL2 version, and it was long since merged into the "master" branch, which I recommend to use now.
It's quite possible that its README is also very much outdated.
The old branch should be deleted, as it's no longer necessary.

Quote from: Monsieur OUXX on Thu 02/09/2021 18:18:51
6. In project Engine.App, set the path to SDL2's include folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php
7. In project Engine.App, set the path to SDL2's lib folder as shown here : https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php

If you will be using current "master", I recommend to set up user's enviroment variables instead of modifying the projects, as the opensource projects are shared among all users and should not normally contain absolute paths. You will find more detailed instructions with links to microsoft docs in the recent README: https://github.com/adventuregamestudio/ags/tree/master/Windows#building-ags-engine

Quote from: eri0o on Fri 03/09/2021 10:17:09
latest release of master branch includes a zip file with Windows Visual Studio project Dependencies pre-built

For the reference, here's latest release page: https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.8
The prebuilt package is called "WinDevDependenciesVS.zip", here's direct link: https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.8/WinDevDependenciesVS.zip
We should update instructions in the readme to either directing to the same package or mentioning where to get one.

Monsieur OUXX

#4
Quote from: Crimson Wizard on Fri 03/09/2021 10:39:22
"ags3--sdl2" was a temporary branch where we prepared SDL2 version, and it was long since merged into the "master" branch.
OK cool, didn't know that.


Quote from: Crimson Wizard on Fri 03/09/2021 10:39:22
I recommend to set up user's enviroment variables instead of modifying the projects
Yes, I'll do that. For now I just want to see if I can compile at all.


Quote from: Crimson Wizard on Fri 03/09/2021 10:39:22
For the reference, here's latest release page: https://github.com/adventuregamestudio/ags/releases/tag/v.3.6.0.8
The prebuilt package is called "WinDevDependenciesVS.zip", here's direct link: https://github.com/adventuregamestudio/ags/releases/download/v.3.6.0.8/WinDevDependenciesVS.zip

New questions
1. Do the releases always have a Dependencies package released? If yes then maybe the readme should just say "Go to the latest version's forum thread".
2. What about Native? Is it still used at all or has it finally been ousted? (no need to give details, just yes or no)
3. What about the Compiler solution? Can it just be compiled out of the box? Is it simpler to grab the DLL from the latest AGS release? where do we get the .h files when compiling NoNative?
 

eri0o

The WinDevDependenciesVS.zip package is really recent, it was added on last version - I got a new PC and had to configure it so decided to add it (and we had a ticket on the issue tracker for it). We could add a bootstrap script (to set-up dev environment) and I honestly planned on adding one after the package was included in releases, but I am in the midst of too much homework (studying coding stuff) and had zilch time. :/

Monsieur OUXX

#6
Quote from: eri0o on Fri 03/09/2021 12:21:09
The WinDevDependenciesVS.zip package is really recent, it was added on last version - I got a new PC and had to configure it so decided to add it (and we had a ticket on the issue tracker for it). We could add a bootstrap script (to set-up dev environment) and I honestly planned on adding one after the package was included in releases, but I am in the midst of too much homework (studying coding stuff) and had zilch time. :/

Have you considered using NuGet in C++? That's slowly becoming a thing. SDL is there.
EDIT: Added more quesiton sin my last post above ^
 

eri0o

#7
We use NuGet only for xiph libraries - but it requires Azure Classic for shipping. It's fetch on the pipeline that builds the docker image. But the package above already contains those binaries.

NuGet can't have truly automated releases, a person has to be responsible for it - to actually submit the package. Plus we actually use Docker instead.

There are a bunch of things that won't work with NuGet (found a bug upstream and want to test and fix on AGS? How to do this in a NuGet workflow?) you can see that most MS own repositories use either CMake (and maybe with vcpkg too) or VS Solutions with a bootstrap script. (A bootstrap script is really useful to check for environment build dependencies, like do we have the C++/CLI compiler we need for AGS Native with .NET 4.5 ?)

Monsieur OUXX

OK that was all gibberish to me but I'll take your word for it.
Did you see the other questions?
 

Crimson Wizard

#9
Quote from: Monsieur OUXX on Fri 03/09/2021 11:58:19
2. What about Native? Is it still used at all or has it finally been ousted? (no need to give details, just yes or no)

Editor still uses native dll.

Quote from: Monsieur OUXX on Fri 03/09/2021 11:58:19
3. What about the Compiler solution? Can it just be compiled out of the box?

Which Compiler solution are you refering to, we have two now: Compiler.Lib.sln which makes a script compiler library, and Compiler.App.sln which makes a script compiler frontend (exe).

Quote from: Monsieur OUXX on Fri 03/09/2021 11:58:19
Is it simpler to grab the DLL from the latest AGS release?

Uhm... I assume that you are refering to AGS.Native.dll? It is simple to take one from a release, but then it means that you won't be able to change this part of the editor; also depending on which version or commit you are building you may run in a situation where Editor requires newer native code and the one got from release is not matching these expectations.

Quote from: Monsieur OUXX on Fri 03/09/2021 11:58:19
where do we get the .h files when compiling NoNative?

NoNative solution is pure C# and does not require any .h files.

Monsieur OUXX

Quote from: Crimson Wizard on Fri 03/09/2021 15:09:48
NoNative solution is pure C# and does not require any .h files.
Ah yes duh. Thanks for all the answers! (I don't need to know more about the compiler)
 

SMF spam blocked by CleanTalk