Mar 17, 2014 at 8:19pm UTC
I try to create applications using SDL in Netbeans, but it doesn't works. I try to compile a simple test code, and I suppose that anythings is wrong. This is the error message:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/test
mkdir -p build/Debug/GNU-MacOSX
rm -f "build/Debug/GNU-MacOSX/main.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/GNU-MacOSX/main.o.d" -o build/Debug/GNU-MacOSX/main.o main.cpp
main.cpp:24:33: error: use of undeclared identifier 'SDL_OPENGL'
SDL_SetVideoMode(xres,yres,0,SDL_OPENGL | SDL_HWSURFACE | SDL_FULLSCREEN);
^
main.cpp:24:46: error: use of undeclared identifier 'SDL_HWSURFACE'
SDL_SetVideoMode(xres,yres,0,SDL_OPENGL | SDL_HWSURFACE | SDL_FULLSCREEN);
^
main.cpp:24:62: error: use of undeclared identifier 'SDL_FULLSCREEN'
SDL_SetVideoMode(xres,yres,0,SDL_OPENGL | SDL_HWSURFACE | SDL_FULLSCREEN);
^
main.cpp:36:7: error: use of undeclared identifier 'SDL_GL_SwapBuffers'
SDL_GL_SwapBuffers();
^
4 errors generated.
make[2]: *** [build/Debug/GNU-MacOSX/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
Thanks !
Last edited on Mar 18, 2014 at 6:58pm UTC
Mar 18, 2014 at 9:08am UTC
Do you have SDL 1.2 installed?
Mar 18, 2014 at 11:30am UTC
Well, then that's the problem. The code is using SDL 1.2.
Mar 18, 2014 at 11:32am UTC
All right, I'm gone to try installing SDL1.2. Thanks! (:
Mar 18, 2014 at 11:55am UTC
Seems better, but I don't know what to do with te error.
1 2 3 4 5 6 7 8 9 10 11
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/test
mkdir -p build/Debug/GNU-MacOSX
rm -f "build/Debug/GNU-MacOSX/main.o.d"
g++ -I/Library/Frameworks/SDL.framework/Headers main.cpp SDLmain.m -framework SDL -framework Cocoa -c -g -MMD -MP -MF "build/Debug/GNU-MacOSX/main.o.d" -o build/Debug/GNU-MacOSX/main.o main.cpp
clang: warning: -framework SDL: 'linker' input unused
clang: warning: -framework Cocoa: 'linker' input unused
clang: error: cannot specify -o when generating multiple output files
make[2]: *** [build/Debug/GNU-MacOSX/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
Last edited on Mar 18, 2014 at 12:01pm UTC
Mar 18, 2014 at 12:02pm UTC
The 'linker' stuff are just warnings so I don't think you have to care about that.
I think the error you get is because you mention main.cpp twice.
g++ -I/Library/Frameworks/SDL.framework/Headers main.cpp SDLmain.m -framework SDL -framework Cocoa -c -g -MMD -MP -MF "build/Debug/GNU-MacOSX/main.o.d" -o build/Debug/GNU-MacOSX/main.o main.cpp
Remove one of them.
Last edited on Mar 18, 2014 at 12:04pm UTC
Mar 18, 2014 at 12:30pm UTC
I'm afraid I can't help you. I'm not so familiar with Mac OS and Clang.
Mar 18, 2014 at 9:03pm UTC
OMG jaja I love you! I don't understand you at the beginning. Thanks!
Mar 18, 2014 at 9:06pm UTC
One more question. What's the difference in the code using 1.2 and 2.0?