 |
 | compiling SDL codes |  |
|
Mohsen Jamali
Guest
|
 |
Posted: Thu Apr 12, 2012 6:27 pm |
|
 |
 |
 |
 |
Hi again!
i want to use sdl_draw library i have installed it, this is the instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directorycompilation terminated. what should i do?
this the sdl-draw library:
http://sourceforge.net/projects/sdl-draw/
thanks in advance and have a nice time.
but when i want to compile it, i get the following error:
On Sat, Mar 24, 2012 at 1:14 AM, Alex Barry wrote:
| Quote: |
No problem, now go have fun with SDL.
On Fri, Mar 23, 2012 at 4:43 PM, Mohsen Jamali wrote:
| Quote: |
Thanks again
On Sat, Mar 24, 2012 at 1:11 AM, Alex Barry wrote:
| Quote: |
And by "like" I meant "link"Just always assume the compiler is stupid and you need to tell it every step you want it to take.
-Alex
On Fri, Mar 23, 2012 at 4:40 PM, Mohsen Jamali wrote:
| Quote: |
Thanks dear Alex
On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry wrote:
| Quote: |
You need to like with SDL
g++ -o main main.cpp `sdl-config --libs --cflags`
That should fix you up
-Alex
On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali wrote:
| Quote: |
Hi guys i have installed SDL on my ubuntu 11.10 machine but when i want to compile it i get the following error :
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/ch02/" -*-
Compilation started at Sat Mar 24 00:42:04
g++ -o main main.cpp
/tmp/ccsRr3LE.o: In function `render()':
main.cpp:(.text+0x33): undefined reference to `SDL_LockSurface'
main.cpp:(.text+0x43): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x100): undefined reference to `SDL_UnlockSurface'
main.cpp:(.text+0x124): undefined reference to `SDL_UpdateRect'
/tmp/ccsRr3LE.o: In function `main':
main.cpp:(.text+0x142): undefined reference to `SDL_Init'
main.cpp:(.text+0x14e): undefined reference to `SDL_GetError'
main.cpp:(.text+0x179): undefined reference to `SDL_Quit'
main.cpp:(.text+0x197): undefined reference to `SDL_SetVideoMode'
main.cpp:(.text+0x1af): undefined reference to `SDL_GetError'
main.cpp:(.text+0x215): undefined reference to `SDL_PollEvent'
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Sat Mar 24 00:42:06
could anyone say whats wrong with me? i'm using emacs editor and use this command to compile:
Compile command: gcc -o main main.cpp
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
MrOzBarry
| Joined: 26 Jun 2010 |
| Posts: 446 |
|
|
 |
Posted: Thu Apr 12, 2012 6:31 pm |
|
 |
 |
 |
 |
What output do you get when you do:$ sdl-config --cflags
Also, how did you install sdl_draw?
-Alex
On Thu, Apr 12, 2012 at 2:26 PM, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directorycompilation terminated. what should i do?
this the sdl-draw library:
http://sourceforge.net/projects/sdl-draw/
thanks in advance and have a nice time.
but when i want to compile it, i get the following error:
On Sat, Mar 24, 2012 at 1:14 AM, Alex Barry wrote:
| Quote: |
No problem, now go have fun with SDL.
On Fri, Mar 23, 2012 at 4:43 PM, Mohsen Jamali wrote:
| Quote: |
Thanks again
On Sat, Mar 24, 2012 at 1:11 AM, Alex Barry wrote:
| Quote: |
And by "like" I meant "link"Just always assume the compiler is stupid and you need to tell it every step you want it to take.
-Alex
On Fri, Mar 23, 2012 at 4:40 PM, Mohsen Jamali wrote:
| Quote: |
Thanks dear Alex
On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry wrote:
| Quote: |
You need to like with SDL
g++ -o main main.cpp `sdl-config --libs --cflags`
That should fix you up
-Alex
On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali wrote:
| Quote: |
Hi guys i have installed SDL on my ubuntu 11.10 machine but when i want to compile it i get the following error :
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/ch02/" -*-
Compilation started at Sat Mar 24 00:42:04
g++ -o main main.cpp
/tmp/ccsRr3LE.o: In function `render()':
main.cpp:(.text+0x33): undefined reference to `SDL_LockSurface'
main.cpp:(.text+0x43): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x100): undefined reference to `SDL_UnlockSurface'
main.cpp:(.text+0x124): undefined reference to `SDL_UpdateRect'
/tmp/ccsRr3LE.o: In function `main':
main.cpp:(.text+0x142): undefined reference to `SDL_Init'
main.cpp:(.text+0x14e): undefined reference to `SDL_GetError'
main.cpp:(.text+0x179): undefined reference to `SDL_Quit'
main.cpp:(.text+0x197): undefined reference to `SDL_SetVideoMode'
main.cpp:(.text+0x1af): undefined reference to `SDL_GetError'
main.cpp:(.text+0x215): undefined reference to `SDL_PollEvent'
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Sat Mar 24 00:42:06
could anyone say whats wrong with me? i'm using emacs editor and use this command to compile:
Compile command: gcc -o main main.cpp
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
Nikos Chantziaras
Guest
|
 |
Posted: Thu Apr 12, 2012 8:05 pm |
|
 |
 |
 |
 |
On 12/04/12 21:26, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the
instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directory
compilation terminated.
what should i do?
|
You should add the output of "pkg-config sdl --cflags" to the compile
flags, and the output of "pkg-config sdl --libs" to the link flags. For
an all-in-one command that compiles and links in one step if you don't
use a Makefile:
$ gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c
$(pkg-config sdl --libs)
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
 |
 | compiling SDL codes |  |
|
Mohsen Jamali
Guest
|
 |
Posted: Fri Apr 13, 2012 4:18 pm |
|
 |
 |
 |
 |
This is the output:
-I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
i have installed it according to instructions in INSTALL file:
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
On Thu, Apr 12, 2012 at 11:01 PM, Alex Barry wrote:
| Quote: |
What output do you get when you do:$ sdl-config --cflags
Also, how did you install sdl_draw?
-Alex
On Thu, Apr 12, 2012 at 2:26 PM, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directorycompilation terminated. what should i do?
this the sdl-draw library:
http://sourceforge.net/projects/sdl-draw/
thanks in advance and have a nice time.
but when i want to compile it, i get the following error:
On Sat, Mar 24, 2012 at 1:14 AM, Alex Barry wrote:
| Quote: |
No problem, now go have fun with SDL.
On Fri, Mar 23, 2012 at 4:43 PM, Mohsen Jamali wrote:
| Quote: |
Thanks again
On Sat, Mar 24, 2012 at 1:11 AM, Alex Barry wrote:
| Quote: |
And by "like" I meant "link"Just always assume the compiler is stupid and you need to tell it every step you want it to take.
-Alex
On Fri, Mar 23, 2012 at 4:40 PM, Mohsen Jamali wrote:
| Quote: |
Thanks dear Alex
On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry wrote:
| Quote: |
You need to like with SDL
g++ -o main main.cpp `sdl-config --libs --cflags`
That should fix you up
-Alex
On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali wrote:
| Quote: |
Hi guys i have installed SDL on my ubuntu 11.10 machine but when i want to compile it i get the following error :
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/ch02/" -*-
Compilation started at Sat Mar 24 00:42:04
g++ -o main main.cpp
/tmp/ccsRr3LE.o: In function `render()':
main.cpp:(.text+0x33): undefined reference to `SDL_LockSurface'
main.cpp:(.text+0x43): undefined reference to `SDL_GetTicks'
main.cpp:(.text+0x100): undefined reference to `SDL_UnlockSurface'
main.cpp:(.text+0x124): undefined reference to `SDL_UpdateRect'
/tmp/ccsRr3LE.o: In function `main':
main.cpp:(.text+0x142): undefined reference to `SDL_Init'
main.cpp:(.text+0x14e): undefined reference to `SDL_GetError'
main.cpp:(.text+0x179): undefined reference to `SDL_Quit'
main.cpp:(.text+0x197): undefined reference to `SDL_SetVideoMode'
main.cpp:(.text+0x1af): undefined reference to `SDL_GetError'
main.cpp:(.text+0x215): undefined reference to `SDL_PollEvent'
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Sat Mar 24 00:42:06
could anyone say whats wrong with me? i'm using emacs editor and use this command to compile:
Compile command: gcc -o main main.cpp
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
Mohsen Jamali
Guest
|
 |
Posted: Fri Apr 13, 2012 4:19 pm |
|
 |
 |
 |
 |
Again have some errors:
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 10:13:16
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c  .text+0x44e): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x47a): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x4a6): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x4d2): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x4fe): undefined reference to `Draw_Line'
/tmp/cc3CtjrF.o:sdldrawtest.c  .text+0x52a): more undefined references to `Draw_Line' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c  .text+0x631): undefined reference to `Draw_Circle'
sdldrawtest.c  .text+0x657): undefined reference to `Draw_Circle'
sdldrawtest.c  .text+0x67d): undefined reference to `Draw_Circle'
sdldrawtest.c  .text+0x6c0): undefined reference to `Draw_Circle'
sdldrawtest.c  .text+0x703): undefined reference to `Draw_Circle'
/tmp/cc3CtjrF.o:sdldrawtest.c  .text+0x746): more undefined references to `Draw_Circle' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c  .text+0x789): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x7d2): undefined reference to `Draw_Circle'
sdldrawtest.c  .text+0x7f8): undefined reference to `Draw_Circle'
sdldrawtest.c  .text+0x81e): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x84a): undefined reference to `Draw_Circle'
sdldrawtest.c  .text+0x870): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x89c): undefined reference to `Draw_Circle'
sdldrawtest.c  .text+0x8c2): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x8ee): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x91a): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x946): undefined reference to `Draw_Line'
sdldrawtest.c  .text+0x972): undefined reference to `Draw_Rect'
sdldrawtest.c  .text+0x99e): undefined reference to `Draw_Rect'
sdldrawtest.c  .text+0x9ca): undefined reference to `Draw_Rect'
sdldrawtest.c  .text+0x9f6): undefined reference to `Draw_HLine'
sdldrawtest.c  .text+0xa1c): undefined reference to `Draw_VLine'
sdldrawtest.c  .text+0xa42): undefined reference to `Draw_Rect'
sdldrawtest.c  .text+0xa6e): undefined reference to `Draw_Pixel'
sdldrawtest.c  .text+0xa8e): undefined reference to `Draw_Pixel'
sdldrawtest.c  .text+0xacb): undefined reference to `Draw_Pixel'
sdldrawtest.c  .text+0xb08): undefined reference to `Draw_Pixel'
sdldrawtest.c  .text+0xb45): undefined reference to `Draw_Ellipse'
sdldrawtest.c  .text+0xb71): undefined reference to `Draw_FillEllipse'
sdldrawtest.c  .text+0xbba): undefined reference to `Draw_Ellipse'
sdldrawtest.c  .text+0xc03): undefined reference to `Draw_Round'
sdldrawtest.c  .text+0xc35): undefined reference to `Draw_Round'
sdldrawtest.c  .text+0xc7f): undefined reference to `Draw_FillRound'
sdldrawtest.c  .text+0xcc9): undefined reference to `Draw_Round'
sdldrawtest.c  .text+0xcfb): undefined reference to `Draw_Rect'
sdldrawtest.c  .text+0xd90): undefined reference to `Draw_FillCircle'
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Fri Apr 13 10:13:17
On Fri, Apr 13, 2012 at 12:32 AM, Nikos Chantziaras wrote:
| Quote: |
On 12/04/12 21:26, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the
instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directory
compilation terminated.
what should i do?
|
You should add the output of "pkg-config sdl --cflags" to the compile flags, and the output of "pkg-config sdl --libs" to the link flags. For an all-in-one command that compiles and links in one step if you don't use a Makefile:
$ gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
Mohsen Jamali
Guest
|
 |
Posted: Fri Apr 13, 2012 4:26 pm |
|
 |
 |
 |
 |
i get this error the former post is wrong:
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*- Compilation started at Fri Apr 13 14:06:43gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs) sdldrawtest.c:27:22: fatal error: SDL_draw.h: No such file or directorycompilation terminated. Compilation exited abnormally with code 1 at Fri Apr 13 14:06:43
On Fri, Apr 13, 2012 at 12:32 AM, Nikos Chantziaras wrote:
| Quote: |
On 12/04/12 21:26, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the
instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directory
compilation terminated.
what should i do?
|
You should add the output of "pkg-config sdl --cflags" to the compile flags, and the output of "pkg-config sdl --libs" to the link flags. For an all-in-one command that compiles and links in one step if you don't use a Makefile:
$ gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
MrOzBarry
| Joined: 26 Jun 2010 |
| Posts: 446 |
|
|
 |
Posted: Fri Apr 13, 2012 4:50 pm |
|
 |
 |
 |
 |
Are you compiling this against SDL 1.2 or 1.3/2.0? If 1.2, was it installed with default settings?-Alex
On Fri, Apr 13, 2012 at 1:46 AM, Mohsen Jamali wrote:
| Quote: |
Again have some errors:
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 10:13:16
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x44e): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x47a): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4a6): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4d2): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4fe): undefined reference to `Draw_Line'
/tmp/cc3CtjrF.o:sdldrawtest.c .text+0x52a): more undefined references to `Draw_Line' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x631): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x657): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x67d): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x6c0): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x703): undefined reference to `Draw_Circle'
/tmp/cc3CtjrF.o:sdldrawtest.c .text+0x746): more undefined references to `Draw_Circle' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x789): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x7d2): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x7f8): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x81e): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x84a): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x870): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x89c): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x8c2): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x8ee): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x91a): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x946): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x972): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x99e): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x9ca): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x9f6): undefined reference to `Draw_HLine'
sdldrawtest.c .text+0xa1c): undefined reference to `Draw_VLine'
sdldrawtest.c .text+0xa42): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0xa6e): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xa8e): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xacb): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xb08): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xb45): undefined reference to `Draw_Ellipse'
sdldrawtest.c .text+0xb71): undefined reference to `Draw_FillEllipse'
sdldrawtest.c .text+0xbba): undefined reference to `Draw_Ellipse'
sdldrawtest.c .text+0xc03): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xc35): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xc7f): undefined reference to `Draw_FillRound'
sdldrawtest.c .text+0xcc9): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xcfb): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0xd90): undefined reference to `Draw_FillCircle'
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Fri Apr 13 10:13:17
On Fri, Apr 13, 2012 at 12:32 AM, Nikos Chantziaras wrote:
| Quote: |
On 12/04/12 21:26, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the
instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directory
compilation terminated.
what should i do?
|
You should add the output of "pkg-config sdl --cflags" to the compile flags, and the output of "pkg-config sdl --libs" to the link flags. For an all-in-one command that compiles and links in one step if you don't use a Makefile:
$ gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
Nikos Chantziaras
Guest
|
 |
Posted: Fri Apr 13, 2012 4:55 pm |
|
 |
 |
 |
 |
On 13/04/12 12:38, Mohsen Jamali wrote:
| Quote: |
*i get this error the former post is wrong:*
-*- mode: compilation; default-directory:
"/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 14:06:43
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config
sdl --libs)
sdldrawtest.c:27:22: fatal error: SDL_draw.h: No such file or directory
compilation terminated.
Compilation exited abnormally with code 1 at Fri Apr 13 14:06:43
|
I just tried out SDL_draw myself. It does not install its header file
when you do "make install". You can do this manually by copying
SDL_draw.h to wherever your system SDL is installed (might be
/usr/include/SDL/ or /usr/local/include/SDL/).
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
 | compiling SDL codes |  |
|
Nikos Chantziaras
Guest
|
 |
Posted: Fri Apr 13, 2012 5:00 pm |
|
 |
 |
 |
 |
On 13/04/12 19:54, Nikos Chantziaras wrote:
| Quote: |
On 13/04/12 12:38, Mohsen Jamali wrote:
| Quote: |
*i get this error the former post is wrong:*
-*- mode: compilation; default-directory:
"/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 14:06:43
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config
sdl --libs)
sdldrawtest.c:27:22: fatal error: SDL_draw.h: No such file or directory
compilation terminated.
Compilation exited abnormally with code 1 at Fri Apr 13 14:06:43
|
I just tried out SDL_draw myself. It does not install its header file
when you do "make install". You can do this manually by copying
SDL_draw.h to wherever your system SDL is installed (might be
/usr/include/SDL/ or /usr/local/include/SDL/).
|
Oh, and you will need to also link against the libSDL_draw library.
SDL_draw does not provide a pkg-config file, so you need to do this
manually:
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config
sdl --libs) -lSDL_draw
Also note that after you have installed SDL_draw (make install), you
need to run "ldconfig" (as root) so that the linker will update its list
of libraries and can find the library.
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
 |
 | compiling SDL codes |  |
|
Mohsen Jamali
Guest
|
 |
Posted: Fri Apr 13, 2012 5:51 pm |
|
 |
 |
 |
 |
SDL_draw-1.2.13
SDL-1.2.15
yeah, with default settings(Instruction that was in readme file).
On Fri, Apr 13, 2012 at 9:19 PM, Alex Barry wrote:
| Quote: |
Are you compiling this against SDL 1.2 or 1.3/2.0? If 1.2, was it installed with default settings?-Alex
On Fri, Apr 13, 2012 at 1:46 AM, Mohsen Jamali wrote:
| Quote: |
Again have some errors:
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 10:13:16
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x44e): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x47a): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4a6): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4d2): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4fe): undefined reference to `Draw_Line'
/tmp/cc3CtjrF.o:sdldrawtest.c .text+0x52a): more undefined references to `Draw_Line' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x631): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x657): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x67d): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x6c0): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x703): undefined reference to `Draw_Circle'
/tmp/cc3CtjrF.o:sdldrawtest.c .text+0x746): more undefined references to `Draw_Circle' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x789): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x7d2): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x7f8): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x81e): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x84a): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x870): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x89c): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x8c2): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x8ee): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x91a): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x946): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x972): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x99e): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x9ca): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x9f6): undefined reference to `Draw_HLine'
sdldrawtest.c .text+0xa1c): undefined reference to `Draw_VLine'
sdldrawtest.c .text+0xa42): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0xa6e): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xa8e): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xacb): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xb08): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xb45): undefined reference to `Draw_Ellipse'
sdldrawtest.c .text+0xb71): undefined reference to `Draw_FillEllipse'
sdldrawtest.c .text+0xbba): undefined reference to `Draw_Ellipse'
sdldrawtest.c .text+0xc03): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xc35): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xc7f): undefined reference to `Draw_FillRound'
sdldrawtest.c .text+0xcc9): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xcfb): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0xd90): undefined reference to `Draw_FillCircle'
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Fri Apr 13 10:13:17
On Fri, Apr 13, 2012 at 12:32 AM, Nikos Chantziaras wrote:
| Quote: |
On 12/04/12 21:26, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the
instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directory
compilation terminated.
what should i do?
|
You should add the output of "pkg-config sdl --cflags" to the compile flags, and the output of "pkg-config sdl --libs" to the link flags. For an all-in-one command that compiles and links in one step if you don't use a Makefile:
$ gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
MrOzBarry
| Joined: 26 Jun 2010 |
| Posts: 446 |
|
|
 |
Posted: Fri Apr 13, 2012 5:54 pm |
|
 |
 |
 |
 |
Did Nikos' last two posts resolve it?
On Fri, Apr 13, 2012 at 1:50 PM, Mohsen Jamali wrote:
| Quote: |
SDL_draw-1.2.13
SDL-1.2.15
yeah, with default settings(Instruction that was in readme file).
On Fri, Apr 13, 2012 at 9:19 PM, Alex Barry wrote:
| Quote: |
Are you compiling this against SDL 1.2 or 1.3/2.0? If 1.2, was it installed with default settings?-Alex
On Fri, Apr 13, 2012 at 1:46 AM, Mohsen Jamali wrote:
| Quote: |
Again have some errors:
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 10:13:16
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x44e): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x47a): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4a6): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4d2): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4fe): undefined reference to `Draw_Line'
/tmp/cc3CtjrF.o:sdldrawtest.c .text+0x52a): more undefined references to `Draw_Line' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x631): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x657): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x67d): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x6c0): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x703): undefined reference to `Draw_Circle'
/tmp/cc3CtjrF.o:sdldrawtest.c .text+0x746): more undefined references to `Draw_Circle' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x789): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x7d2): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x7f8): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x81e): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x84a): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x870): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x89c): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x8c2): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x8ee): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x91a): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x946): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x972): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x99e): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x9ca): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x9f6): undefined reference to `Draw_HLine'
sdldrawtest.c .text+0xa1c): undefined reference to `Draw_VLine'
sdldrawtest.c .text+0xa42): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0xa6e): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xa8e): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xacb): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xb08): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xb45): undefined reference to `Draw_Ellipse'
sdldrawtest.c .text+0xb71): undefined reference to `Draw_FillEllipse'
sdldrawtest.c .text+0xbba): undefined reference to `Draw_Ellipse'
sdldrawtest.c .text+0xc03): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xc35): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xc7f): undefined reference to `Draw_FillRound'
sdldrawtest.c .text+0xcc9): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xcfb): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0xd90): undefined reference to `Draw_FillCircle'
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Fri Apr 13 10:13:17
On Fri, Apr 13, 2012 at 12:32 AM, Nikos Chantziaras wrote:
| Quote: |
On 12/04/12 21:26, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the
instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directory
compilation terminated.
what should i do?
|
You should add the output of "pkg-config sdl --cflags" to the compile flags, and the output of "pkg-config sdl --libs" to the link flags. For an all-in-one command that compiles and links in one step if you don't use a Makefile:
$ gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
Mohsen Jamali
Guest
|
 |
Posted: Fri Apr 13, 2012 6:08 pm |
|
 |
 |
 |
 |
what is your compiling command?
On Fri, Apr 13, 2012 at 9:24 PM, Nikos Chantziaras wrote:
| Quote: |
On 13/04/12 12:38, Mohsen Jamali wrote:
| Quote: |
*i get this error the former post is wrong:*
-*- mode: compilation; default-directory:
"/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 14:06:43
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config
sdl --libs)
sdldrawtest.c:27:22: fatal error: SDL_draw.h: No such file or directory
compilation terminated.
Compilation exited abnormally with code 1 at Fri Apr 13 14:06:43
|
I just tried out SDL_draw myself. It does not install its header file when you do "make install". You can do this manually by copying SDL_draw.h to wherever your system SDL is installed (might be /usr/include/SDL/ or /usr/local/include/SDL/).
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
Mohsen Jamali
Guest
|
 |
Posted: Fri Apr 13, 2012 6:11 pm |
|
 |
 |
 |
 |
wait testing!
On Fri, Apr 13, 2012 at 10:23 PM, Alex Barry wrote:
| Quote: |
Did Nikos' last two posts resolve it?
On Fri, Apr 13, 2012 at 1:50 PM, Mohsen Jamali wrote:
| Quote: |
SDL_draw-1.2.13
SDL-1.2.15
yeah, with default settings(Instruction that was in readme file).
On Fri, Apr 13, 2012 at 9:19 PM, Alex Barry wrote:
| Quote: |
Are you compiling this against SDL 1.2 or 1.3/2.0? If 1.2, was it installed with default settings?-Alex
On Fri, Apr 13, 2012 at 1:46 AM, Mohsen Jamali wrote:
| Quote: |
Again have some errors:
-*- mode: compilation; default-directory: "/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 10:13:16
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x44e): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x47a): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4a6): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4d2): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x4fe): undefined reference to `Draw_Line'
/tmp/cc3CtjrF.o:sdldrawtest.c .text+0x52a): more undefined references to `Draw_Line' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x631): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x657): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x67d): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x6c0): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x703): undefined reference to `Draw_Circle'
/tmp/cc3CtjrF.o:sdldrawtest.c .text+0x746): more undefined references to `Draw_Circle' follow
/tmp/cc3CtjrF.o: In function `main':
sdldrawtest.c .text+0x789): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x7d2): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x7f8): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x81e): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x84a): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x870): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x89c): undefined reference to `Draw_Circle'
sdldrawtest.c .text+0x8c2): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x8ee): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x91a): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x946): undefined reference to `Draw_Line'
sdldrawtest.c .text+0x972): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x99e): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x9ca): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0x9f6): undefined reference to `Draw_HLine'
sdldrawtest.c .text+0xa1c): undefined reference to `Draw_VLine'
sdldrawtest.c .text+0xa42): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0xa6e): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xa8e): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xacb): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xb08): undefined reference to `Draw_Pixel'
sdldrawtest.c .text+0xb45): undefined reference to `Draw_Ellipse'
sdldrawtest.c .text+0xb71): undefined reference to `Draw_FillEllipse'
sdldrawtest.c .text+0xbba): undefined reference to `Draw_Ellipse'
sdldrawtest.c .text+0xc03): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xc35): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xc7f): undefined reference to `Draw_FillRound'
sdldrawtest.c .text+0xcc9): undefined reference to `Draw_Round'
sdldrawtest.c .text+0xcfb): undefined reference to `Draw_Rect'
sdldrawtest.c .text+0xd90): undefined reference to `Draw_FillCircle'
collect2: ld returned 1 exit status
Compilation exited abnormally with code 1 at Fri Apr 13 10:13:17
On Fri, Apr 13, 2012 at 12:32 AM, Nikos Chantziaras wrote:
| Quote: |
On 12/04/12 21:26, Mohsen Jamali wrote:
| Quote: |
Hi again!
i want to use sdl_draw library i have installed it, this is the
instruction to compile:
"
The file sdldrawtest.c is a example application for the library. You can
compile it using (for GNU Compiler):
$ export CFLAGS="`sdl-config --cflags` -I./include"
$ export LIBS="`sdl-config --libs` ./src/.libs/libSDL_draw.a"
$ gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
"
but after running the last line i get the following error:
gcc -o sdldrawtest sdldrawtest.c -Wall $CFLAGS $LIBS
sdldrawtest.c:25:17: fatal error: SDL.h: No such file or directory
compilation terminated.
what should i do?
|
You should add the output of "pkg-config sdl --cflags" to the compile flags, and the output of "pkg-config sdl --libs" to the link flags. For an all-in-one command that compiles and links in one step if you don't use a Makefile:
$ gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs)
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
 | compiling SDL codes |  |
|
Mohsen Jamali
Guest
|
 |
Posted: Fri Apr 13, 2012 6:16 pm |
|
 |
 |
 |
 |
it works!
thanks Alex
thanks Nikos
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs) -lSDL_draw
Compilation finished at Fri Apr 13 22:42:1
On Fri, Apr 13, 2012 at 9:29 PM, Nikos Chantziaras wrote:
| Quote: |
On 13/04/12 19:54, Nikos Chantziaras wrote:
| Quote: |
On 13/04/12 12:38, Mohsen Jamali wrote:
| Quote: |
*i get this error the former post is wrong:*
-*- mode: compilation; default-directory:
"/home/mohsen/Desktop/Project/libs_to_install/SDL_draw-1.2.13/" -*-
Compilation started at Fri Apr 13 14:06:43
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config
sdl --libs)
sdldrawtest.c:27:22: fatal error: SDL_draw.h: No such file or directory
compilation terminated.
Compilation exited abnormally with code 1 at Fri Apr 13 14:06:43
|
I just tried out SDL_draw myself. It does not install its header file
when you do "make install". You can do this manually by copying
SDL_draw.h to wherever your system SDL is installed (might be
/usr/include/SDL/ or /usr/local/include/SDL/).
|
Oh, and you will need to also link against the libSDL_draw library. SDL_draw does not provide a pkg-config file, so you need to do this manually:
gcc $(pkg-config sdl --cflags) -o sdldrawtest sdldrawtest.c $(pkg-config sdl --libs) -lSDL_draw
Also note that after you have installed SDL_draw (make install), you need to run "ldconfig" (as root) so that the linker will update its list of libraries and can find the library.
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
|
|
|
|
 |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
|
|  |