C++ Sdl With Dev C++

When I compile the following two programs one of them compiles and one of themse does not but I don't see a difference. The smaller program is the same only I've taken out a lot of the code so that I'm left with only the minimum that I need to display a window with SDL. I think it would be easier to learn with fewer lines of code and slowly learn the extra and more complicated aspects of using SDL.

In the code above I'm getting this error -> Window.cpp|10|undefined reference to SDL_Init'|
Window.cpp|12|undefined reference to SDL_SetVideoMode'|

Helicopter Game in C with SDL. The Helicopter Game in C is an interesting game/console application designed in the object oriented programming language – C, with the use of SDL graphics. The game is an excellent example of utilization of C programming language in. Oct 30, 2015  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. SDLPoint uses the wrong type (int), but we can easily define our own Point class to use instead. We can convert to the necessary SDL type only when we need to call an SDL function with it. Member functions that don't change member variables (e.g. GetScore, GetSize) should be marked const (e.g. Int GetScore const;).

The following program compiles fine.

C++

C Sdl With Dev C G

  1. Code with C is a comprehensive compilation of Free projects, source codes, books, and tutorials in Java, PHP.NET, Python, C, C, and more. Our main mission is to help out programmers and coders, students and learners in general, with relevant resources and materials in the field of computer programming.
  2. New versions of the SDL extensions don't like old versions of SDL. If you don't, Dev C will compile the program but the program will complain at run time (it's typically something about an entry point). 1)Scroll down to the Binary section and download the Windows development library.
  3. 7 days ago  TL, DR: Will I be able to get a single.exe file which will work smooth in a PC which does not have SDL or so installed ever. If not, how close will be the closest approach? Yes, now, I want to start game development using C/C and I am on a Linux machine.
  • 2 Contributors
  • forum 3 Replies
  • 1,348 Views
  • 1 Day Discussion Span
  • commentLatest Postby mike_2000_17Latest Post

mike_2000_172,669

Sdl

C Sdl With Dev C File

Both programs actually compile fine. The error you got for the first program is a linker error, meaning that it compiled fine but it couldn't link. The error in question is caused by forgetting to link with the SDL library. It is not sufficient to include the header file, you also have to link to the library. Just look at the FAQ for SDL.

Dev C Compiler

If you are confused with the compilation and linking process, I recommend reading my tutorial on that subject.