12-17-2020, 02:36 AM
Compile error when building Tilengine
|
12-17-2020, 03:18 AM
(12-17-2020, 01:08 AM)megamarc Wrote: Hi, Thanks, that was helpful. I downloaded http://gnuwin32.sourceforge.net/downlink...ib-zip.php and copied zlib.lib from that zip to Tilengine-master\src\libpng\Win32 When trying to build I still got some errors: Build started... 1>------ Build started: Project: Tilengine, Configuration: Debug Win32 ------ 1>Tilengine.vcxproj -> C:\Tilengine\Tilengine-master\src\Win32_Debug\Tilengine.dll 1> 1 file(s) copied. 1>The system cannot find the path specified. 1> 0 file(s) copied. 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(153,5): error MSB3073: The command "copy C:\Tilengine\Tilengine-master\src\Win32_Debug\Tilengine.dll C:\Tilengine\Tilengine-master\samples 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(153,5): error MSB3073: copy C:\Tilengine\Tilengine-master\src\Win32_Debug\Tilengine.lib C:\Tilengine\Tilengine-master\lib\Win32 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(153,5): error MSB3073: 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(153,5): error MSB3073: :VCEnd" exited with code 1. 1>Done building project "Tilengine.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== But this was easily fixed by creating the folder C:\Tilengine\Tilengine-master\lib\Win32
12-17-2020, 03:33 AM
Next step... trying to build and run the test project in Tilengine.sln
Building was successful. I've copied all the required .dll's to the folder where test.exe is located (i.e. Tilengine-master\Debug) I've also copied Tilengine-master\samples\assets to this same folder (i.e. Tilengine-master\Debug\assets) When starting test.exe (from the command line) the program seems to hang with the following output: Tilengine v2.8.5 32-bit built Dec 16 2020 17:59:09 Tilengine version 020805 Tilengine: Resource file not found Tilengine: Resource file not found Tilengine: Invalid Tilemap reference Tilengine: Invalid object address is 00000000 Any idea?
12-17-2020, 07:18 AM
Hi,
Seems that assets path relative to the executable is mismatched. By default tilengine loads assets in the same directory as the executable. If they're on another place, you use TLN_SetLoadPath() function. Make sure that the call to this function -if any- matches with the path where you have your assets. Tilengine isn't finding the assets you try to load.
12-17-2020, 07:48 AM
(This post was last modified: 12-17-2020, 07:52 AM by Motherbrain.)
This is from main.c in the test project (that I downloaded from github):
Code: /* test layer */ The assets folder is in the same folder as the exectuable. I checked to see if the required asset is actually at the expected location and it is. When I try to step into (F11) TLN_LoadTilemap("assets/sonic/Sonic_md_bg1.tmx", NULL) nothing happens and the process seems to hang. Not sure why I can't even step into that function using the debugger in VS2019.
12-17-2020, 07:58 AM
Please note that I'm not writing my own code (yet). I'm just trying to compile and run the source code from Github as is, following the instructions from README.md
12-17-2020, 08:13 AM
Oh I understand, that test.c you found inside the /src directory is designed to validate automatic build status in Travis.ci when pushing to GitHub. It does several illegal operations in purpose, as kind of sanity checks, without even creating a window. So the behaviour you see is the expected one.
The sources you're interested on are located inside /samples folder
12-17-2020, 08:39 AM
(This post was last modified: 12-17-2020, 08:41 AM by Motherbrain.)
Good to know about that test project.
Moving on to the samples. When I open Samples.sln (in the samples folder) and try to build I get the following compile error: 1>C:\Tilengine\Tilengine-master\samples\Simon.c(1,10): fatal error C1083: Cannot open include file: 'Tilengine.h': No such file or directory So I changed "Additional Include Directories" from ..\..\include to ..\include Then I got a linker error: 1>LINK : fatal error LNK1104: cannot open file 'Tilengine.lib' So I changed "Additional Library Directories" from ..\..\lib to ..\lib Then I could build successfully. When I try to run I get a message about missing .dll's I fixed this by copying the required dll's to the folder of the executable. When I run the executable (barrel.exe) a window is created that is red. In the console window I get a lot of error messages: " Tilengine: Invalid object address is 00000000 Tilengine: Invalid Palette reference Tilengine: Invalid object address is 00000000 Tilengine: Invalid Palette reference Tilengine: Invalid object address is 00000000 Tilengine: Invalid Palette reference Tilengine: Invalid object address is 00000000 Tilengine: Invalid Palette reference Tilengine: Invalid object address is 00000000 Tilengine: Invalid Palette reference Tilengine: Invalid object address is 00000000 Tilengine: Invalid Palette reference" etc.
12-17-2020, 08:50 AM
Yeah, you're right. The samples.sln VS solution and related projects are heaviliy outdated. They're based on an old VS2005 branch that had different directory structure. As I always use GNU makefiles to build the samples I forgot totally about them. Should be updated or removed.
Thanks for pointing this issue! |
« Next Oldest | Next Newest »
|
Users browsing this thread: 2 Guest(s)