Looks like you haven't linked in the libraries need for the graphics functions that you are using. Are you linking with gcc or g++?
Hi
when I try to compile my main.cpp, I get this:
I do have #included "graphics.h" and the makefile contains OBJS = main.o graphics.o framebuffer.omain.o: In function `main':
main.cpp:(.text+0xf0): undefined reference to `initGraphics()'
main.cpp:(.text+0xfc): undefined reference to `loadImage(char const*)'
main.cpp:(.text+0x108): undefined reference to `loadImage(char const*)'
main.cpp:(.text+0x114): undefined reference to `loadImage(char const*)'
main.cpp:(.text+0x120): undefined reference to `loadImage(char const*)'
main.cpp:(.text+0x12c): undefined reference to `loadImage(char const*)'
main.cpp:(.text+0x230): undefined reference to `clearScreen(unsigned int)'
main.cpp:(.text+0x27c): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x2d0): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x32c): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x394): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x3e8): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x3f0): undefined reference to `flipScreen()'
main.cpp:(.text+0x4a4): undefined reference to `clearScreen(unsigned int)'
main.cpp:(.text+0x4ec): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x534): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x580): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x5d8): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x630): undefined reference to `printTextScreen(int, int, char c
onst*, unsigned int)'
main.cpp:(.text+0x638): undefined reference to `flipScreen()'
collect2: ld returned 1 exit status
make: *** [pspwAMPxmb.elf] Error 1
What do I do wrong?
Looks like you haven't linked in the libraries need for the graphics functions that you are using. Are you linking with gcc or g++?
gcc. The wierd thing is I defninitely have linked and included everything correctly. It seems that you can't use the C graphics.h libraries in C++...![]()
Yes you can. Again, are you linking with gcc or g++?
gcc
If you are using C++ you MUST compile AND link with g++ NOT gcc.
Beyond the above error, your code/file structure is at fault. Host up ALL your code on to a server somewhere so people can download it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks