User forums > Using Code::Blocks
Linking to Libraries
racer319:
(Cropped out the warnings b/c it exceeded max post length)
--- Code: ----------------- Build: Debug in Space_Shooter ---------------
mingw32-g++.exe -Wall -g -IC:\GameDev\SDL\include -I..\..\..\SDL\include\SDL -c C:\GameDev\C++_Source_Files\Misc\Space_Shooter\main.cpp -o obj\Debug\main.o
C:\GameDev\C++_Source_Files\Misc\Space_Shooter\main.cpp: In function 'int SDL_main(int, char**)':
C:\GameDev\C++_Source_Files\Misc\Space_Shooter\main.cpp:37: error: 'pixelRGBA' was not declared in this scope
C:\GameDev\C++_Source_Files\Misc\Space_Shooter\main.cpp:13: warning: unused variable 'grey'
Process terminated with status 1 (0 minutes, 2 seconds)
1 errors, 234 warnings
--- End code ---
stahta01:
--- Quote from: racer319 on May 02, 2012, 02:33:27 am ---(Cropped out the warnings b/c it exceeded max post length)
--- Code: ----------------- Build: Debug in Space_Shooter ---------------
mingw32-g++.exe -Wall -g -IC:\GameDev\SDL\include -I..\..\..\SDL\include\SDL -c C:\GameDev\C++_Source_Files\Misc\Space_Shooter\main.cpp -o obj\Debug\main.o
C:\GameDev\C++_Source_Files\Misc\Space_Shooter\main.cpp: In function 'int SDL_main(int, char**)':
C:\GameDev\C++_Source_Files\Misc\Space_Shooter\main.cpp:37: error: 'pixelRGBA' was not declared in this scope
C:\GameDev\C++_Source_Files\Misc\Space_Shooter\main.cpp:13: warning: unused variable 'grey'
Process terminated with status 1 (0 minutes, 2 seconds)
1 errors, 234 warnings
--- End code ---
--- End quote ---
I need to see the linker command; the "mingw32-g++.exe -Wall -g" means that is the compiler command or you have a very very messed up Code::Blocks configuration.
NOTE: you did NOT do something stupid like remove the include statement needed to get the code to compile, did you?
Please fix your code so it compiles; then post the link command.
Edit: Going to sleep; I suggest trying another forum; hopefully one that supports your SDL library.
Tim S.
racer319:
Thanks a bunch for the help though. And yeah I probably did do something stupid...
Jenna:
And think about name mangling, if you probably use C-libraries with C++-code.
Radek:
You are getting compiler errors, not linker errors. The problem is not related to your DLLs, at least, so far. A header with "pixelRGBA" declaration has not been found. Check your (project) include path, whether it contains needed headers. Check whether the needed header is present. Also, get rid of those 234 warnings.
Linker errors (which are usually related to missing DLLs, missing libraries or unexpected kind of name mangling) are the complaints of "unresolved reference" or "duplicate reference" in compiled files (*.obj or *.o, not in *.cpp).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version