[SDL2]-3D Ray Casting Demo-Need Some Help! |
JeZ-l-Lee
|
[SDL2]-3D Ray Casting Demo-Need Some Help!
Hi, We found some source code for an SDL2 ray casting demo. We have incorporated it into our cross-platform SDL2 game engine. Our issue now is it won't build on Linux? (builds fine on Windows) You can download the entire project below: http://16bitsoft.com/files/3dRayCasting/Demo/3dRayCasting-Demo.zip Any help fixing errors on Linux would be appreciated! |
|||||||||||
|
[SDL2]-3D Ray Casting Demo-Need Some Help! |
Jonny D
|
What errors are you getting? Are they specific to SDL or is this just a request for help in general?
Jonny D On Thu, May 14, 2015 at 4:49 AM, JeZ-l-Lee wrote:
|
|||||||||||||
|
[SDL2]-3D Ray Casting Demo-Need Some Help! |
Paul Wortmann
Guest
|
I tried to build it on Linux using your Code::Blocks project file and got a linker error.
I set the linker settings correctly in Code::Blocks and was able to build and run your application, although some code warnings were observed. You probably want to fix those warnings, and maybe run it through Valgrind, I have a feeling your application has a few more problems..... I don't think you should be linking -lmingw32 on Linux.I only linked against  lSDL2  lSDL2_ttf lSDL2_image and lSDL2_mixer. Why not setup separate build profiles for different systems? The build output I got was: (with correct linker settings) ||=== Build: Release in 3dRayCasting (compiler: GNU GCC Compiler) ===| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp||In member function ‘void Data::ClearHighScores()’ /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|119|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|118|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|127|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|126|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|135|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|134|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|143|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|142|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|151|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|150|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|159|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|158|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|167|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|166|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|175|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|174|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|183|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|182|note: containing loop| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|191|warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations]| /home/paul/Desktop/3dRayCasting-Demo/src/data.cpp|190|note: containing loop| ||=== Build finished: 0 error(s), 10 warning(s) (0 minute(s), 1 second(s)) ===| On Fri, May 15, 2015 at 12:11 AM, JeZ-l-Lee wrote:
-- Paul Wortmann E-mail : Website: www.physhexgames.co.nr |
|||||||||||||
|
JeZ-l-Lee
|
Hi,
Thanks... We are building on Linux with included makefile and get those errors. Here is the makefile we are using:
Is there something wrong with above makefile? Thanks! |
|||||||||||||
|
[SDL2]-3D Ray Casting Demo-Need Some Help! |
Paul Wortmann
Guest
|
you forgot  instantcg.h / cpp / o in your make file, if I add, it builds.
On Fri, May 15, 2015 at 1:22 AM, JeZ-l-Lee wrote:
-- Paul Wortmann E-mail : Website: www.physhexgames.co.nr |
|||||||||||||
|
[SDL2]-3D Ray Casting Demo-Need Some Help! |
Jonny D
|
I'll second that by saying that's exactly what the makefile's command line output and linker error messages say the problem is.
Jonny D On Thu, May 14, 2015 at 12:32 PM, Paul Wortmann wrote:
|
|||||||||||||||
|
Re: [SDL2]-3D Ray Casting Demo-Need Some Help! |
JeZ-l-Lee
|
That was the problem! Now it builds on Linux! Thanks! |
|||||||||||||
|