Compile error when building Tilengine - Printable Version +- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum) +-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7) +--- Thread: Compile error when building Tilengine (/showthread.php?tid=970) Pages:
1
2
|
RE: Compile error when building Tilengine - megamarc - 12-17-2020 (12-17-2020, 01:50 AM)System64 Wrote: You have to download the right version of Visual Studio Not necessarily. This happens whenever you open a project with a newer version of VS than the one in which the project was created. If you're using VS2019 -perfectly fine- retargetting is the way to go. RE: Compile error when building Tilengine - Motherbrain - 12-17-2020 (12-17-2020, 01:08 AM)megamarc Wrote: Hi, Thanks, that was helpful. I downloaded http://gnuwin32.sourceforge.net/downlinks/zlib-lib-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 RE: Compile error when building Tilengine - Motherbrain - 12-17-2020 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? RE: Compile error when building Tilengine - megamarc - 12-17-2020 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. RE: Compile error when building Tilengine - Motherbrain - 12-17-2020 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. RE: Compile error when building Tilengine - Motherbrain - 12-17-2020 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 RE: Compile error when building Tilengine - megamarc - 12-17-2020 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 RE: Compile error when building Tilengine - Motherbrain - 12-17-2020 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. RE: Compile error when building Tilengine - megamarc - 12-17-2020 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! |