Author Topic: Trouble Building Editor  (Read 386 times)

Trouble Building Editor
« on: 28 Apr 2020, 03:42 »
Hey all, I'm trying to build the editor for the first time and I'm unable to get all the projects happy. The step I'm stuck on in the readme is "setup paths to compiled libraries and their headers either in IDE options (older) or project property pages (newer)". I've successfully built allegro, alfont, downloaded irrKlang and dropped it in the appropriate editor folder, and have been setting the aforementioned builds as additional include directories in the project files that request them. I was also able to install August 2007 directX.

My current errors are the following:
« Last Edit: 28 Apr 2020, 03:45 by Deivore »

eri0o

Re: Trouble Building Editor
« Reply #1 on: 28 Apr 2020, 13:52 »
Which Solution have you tried to open? Where did you get the source code? Which branch?

Re: Trouble Building Editor
« Reply #2 on: 28 Apr 2020, 13:59 »
This is the AGS.Editor.Full.sln
The source code is from https://github.com/adventuregamestudio/ags
The current branch is "master"

Running on windows 7 using MSVS 2015 community.

Re: Trouble Building Editor
« Reply #3 on: 28 Apr 2020, 14:22 »
It sais that it cannot find "alleg-debug-static.lib", which seems as a blocking issue there. (It's needed for the AGS.Native dll)

Have you built allegro from our repository, or from the official one? If latter, you may have to rename the output lib. (In our fork the output names are set up for needs of AGS)

Re: Trouble Building Editor
« Reply #4 on: 28 Apr 2020, 15:16 »
The former; my alleg-debug-static.lib is built from the AGS repo from the patched branch. I put these libs in a folder near my AGS repo and added an entry for it in the windows path variable but I haven't gotten AGS.Native to "see" it which I expect is some kind of project setting I'm unfamiliar with.

Re: Trouble Building Editor
« Reply #5 on: 28 Apr 2020, 15:51 »
Sorry, I myself keep getting bit confused every time with this in new MSVS. There are two kind of path settings, the project's own settings and your local settings.

1. Project own settings are found if you open project's Properties. For C++ projects there's a tab called "VC++ Directories", where you may setup paths to includes and libs, separately.
This is a simpliest way to set these dirs, but changing these will be a change to project itself, and everyone will get them (if you commit to a repo).

2. Local or user settings, on other hand, belong only to you. They are edited in something called "Property Sheets" in MSVS. To edit these, go to View -> Property Manager (or sometimes View -> Other windows -> Property Manager). You will see a tree of folders.
If you open any of the project names and double click "Microsoft.Cpp.Win32.user". That will open your user settings shared between all the C++ MSVS projects.
In there you go to "VC++ Directories" and set up Include and Lib directories which will be used by MSVS on your computer.

Above will actually set directories for all the projects of this kind, which in theory may cause problems if, for example, you need to use separate versions of same lib in different projects. There have to be a way to set user settings up on per-project basis, but I did not try that myself yet. If you're interested, the second link below seems to explain how it's done.

Alternatively, I think that you may also setup "LIB" system variable ("PATH" is strictly for executables), as MSVS mentions on the property page tip, but frankly I don't remember if that works.


There are some docs on this:
https://docs.microsoft.com/en-us/cpp/build/reference/vcpp-directories-property-page?view=vs-2019
https://docs.microsoft.com/en-us/cpp/build/create-reusable-property-configurations?view=vs-2019
« Last Edit: 28 Apr 2020, 16:04 by Crimson Wizard »

Re: Trouble Building Editor
« Reply #6 on: 28 Apr 2020, 16:27 »
Awesome, that solved the AGS library error, cheers! I ended up modifying the project, in development I'd be forking and not committing project changes.

I do have a new error in addition to those listed above, "cannot open file 'dinput.lib'" which appears to be a DirectX library I didn't get from the Aug 2007 download? I'll have to track that one down.

Most of the rest of the errors seem to have to do with various projects being unable to resolve the AGS.Native namespace. The error "NativeMethods is inaccessible" is the compiler assuming a windows' "NativeMethods" is the intended reference, but since there's a "NativeMethods" file in AGS.Native I suspect that error too will disappear when the namespace is resolved.

The weirdest error to me is that the compiler thinks "AGSEditor.exe" is a metadata file?

Re: Trouble Building Editor
« Reply #7 on: 28 Apr 2020, 16:40 »
I added the property sheets to solve this problem.

Code: DOS
  1. set | findstr /b AGS_
  2. AGS_ALFONT_LIB=D:\Build\ags-prebuilt-libs\vs2015\alfont-1.9.1
  3. AGS_ALLEGRO_INCLUDE=D:\Build\lib-allegro\include;D:\Build\lib-allegro\build\VS2015\include
  4. AGS_ALLEGRO_LIB=D:\Build\ags-prebuilt-libs\vs2015\allegro-4.4.2
  5. AGS_DIRECTX_LIB=C:\Program Files (x86)\Microsoft DirectX SDK (August 2007)\Lib\x86\
  6. AGS_LIBOGG_LIB=D:\Build\ags-prebuilt-libs\vs2015\libogg-1.3.2
  7. AGS_LIBTHEORA_LIB=D:\Build\ags-prebuilt-libs\vs2015\libtheora-1.1.1
  8. AGS_LIBVORBIS_LIB=D:\Build\ags-prebuilt-libs\vs2015\libvorbis-1.3.4

Just set these environment variables globally and they will work for all recent Solutions. The Alfont one is no longer required, unless you are building slightly older versions. As a side note: the DirectX installer is very old so I would recommend just extracting the files from the installer, rather than actually installing it.
« Last Edit: 28 Apr 2020, 17:11 by morganw »

Re: Trouble Building Editor
« Reply #8 on: 29 Apr 2020, 02:45 »
Eyy, that did it!! It also took another manual addition to the AGS.Native library references for some reason, but it builds and runs! Thanks so much, all!

Re: Trouble Building Editor
« Reply #9 on: 29 Apr 2020, 02:52 »
Eyy, that did it!! It also took another manual addition to the AGS.Native library references for some reason, but it builds and runs!

Could you tell what did you have to add?