User forums > Using Code::Blocks

SDL2 with CodeBlocks 20.03

<< < (2/2)

omnishambles:
Thanks for your help. In answer to your reply #3, I did a rebuild and the build log is as follows. (I just noticed your edit to reply #3 but am posting this anyway - I'll respond to reply #4 later).

-------------- Clean: Debug in codeblocks_sdltest2 (compiler: GNU GCC Compiler)---------------

Cleaned "codeblocks_sdltest2 - Debug"

-------------- Build: Debug in codeblocks_sdltest2 (compiler: GNU GCC Compiler)---------------

gcc.exe -Wall -g  -c C:\data\source_code\c\codeblocks_sdltest2\main.c -o obj\Debug\main.o
gcc.exe  -o bin\Debug\codeblocks_sdltest2.exe obj\Debug\main.o   
C:\data\source_code\c\codeblocks_sdltest2\main.c:2:10: fatal error: SDL.h: No such file or directory
 #include <SDL.h>
          ^~~~~~~
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

omnishambles:
Re reply#4, I definitely would want to use the wizard instead of setting things up manually as you describe. That's exactly what I want to avoid if at all possible. However, if the wizard doesn't support C there may be no choice. It sounds like it's going to be a long and winding road so I'll have to leave it until the weekend. Thanks for offering to help.

stahta01:
Attached zipped C SDL2 project based on https://www.willusher.io/sdl2%20tutorials/2013/08/17/lesson-1-hello-world

Tim S.

stahta01:

--- Quote from: stahta01 on July 03, 2020, 01:29:59 am ---Most people use "Lazy Foo"; but, I did not like the license.
I tried to use https://www.willusher.io/pages/sdl2/ but decided to stop when something else happened in my life.

--- End quote ---

Since "Lazy Foo" uses C and www.willusher.io uses C++ you likely will want to use "Lazy Foo".
But, if this is for commercial use you likely want to find another place to learn SDL2!
Unless the license for "Lazy Foo" has changed since 5 years, ago.

Tim S.


omnishambles:
Quick reply - your project worked perfectly on my machine. Thanks!

I don't understand how CB works yet, but clearly some settings relating to libraries, search paths, etc. are set in the project file as opposed to CB's settings menus. Per-project settings as opposed to global CB settings I guess. Haven't got time to look closely now, but I'm very pleased that it works at all, and will look at this over the weekend. Many thanks again.

On the licence issue, I see what you mean about Lazy Foo. I use tutorials to learn principles from rather than copy/paste from, so that shouldn't be a problem. I'll use the libsdl docs as a starting point anyway.

Navigation

[0] Message Index

[*] Previous page

Go to full version