0
How to fix the error?
DevC++ I wrote the code #include "SDL2/SDL.h" #define int SDL_main(int argc, char **args) { // START SDL // Quit SDL return 0; } Compilation and here an error 1) Error cannot file - ISDLmain cannot file -ISDL 2) Makefile.win $(BIN) : $(OBJ) $(CPP) $(LINKOBJ) - o (BIN) $(LIBS)
12 Respuestas
+ 1
SDL main should have parameters int and char** I believe. Also, it might be so that your SDL_main should be renamed to main. I worked with version 2.
0
Duck Typed I wrote the parameters, it does not work, I also have version 2.0
0
Duck Typed
In terminal :
undefined reference to 'WinMan'
Error id returned 1 exit status
0
Did you try renaming SDL_main to main? Also, Lazy Foo productions on Google has a good tutorial on setting up SDL, build settings included.
0
Duck Typed No I just wrote SDL_main
0
Duck Typed link please?
0
The problem has not been resolved yet. Well, if there are options, tell
0
1. Change SDL_main to int main(int argc, char **argv)
2. If you're using SDL2 try the linker flag -lSDL2
Tell me if this sample code is working for you:
#include "SDL2/SDL.h"
#include <stdio.h>
int main(int argc, char **argv)
{
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
fprintf(stderr, "Failed to initialize SDL.\n");
return 1;
} else {
printf("Successfully initialized SDL.\n");
}
SDL_Quit();
return 0;
}
0
Cluck'n'Coder
In terminal :
undefined reference to 'WinMan'
Error id returned 1 exit status
0
Cluck'n'Coder not working
0
Cluck'n'Coder as you said did everything