compiling SDL codes |
Mohsen Jamali
Guest
|
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:
|
|||||||||||||||||||||||
|
compiling SDL codes |
MrOzBarry
|
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:
|
|||||||||||||||||||||||||
|
compiling SDL codes |
Nikos Chantziaras
Guest
|
On 12/04/12 21:26, Mohsen Jamali wrote:
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
|
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:
|
|||||||||||||||||||||||||||
|
compiling SDL codes |
Mohsen Jamali
Guest
|
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:
|
|||||||||||||||
|
compiling SDL codes |
Mohsen Jamali
Guest
|
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:
|
|||||||||||||||
|
compiling SDL codes |
MrOzBarry
|
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:
|
|||||||||||||||||
|
compiling SDL codes |
Nikos Chantziaras
Guest
|
On 13/04/12 12:38, Mohsen Jamali wrote:
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
|
On 13/04/12 19:54, Nikos Chantziaras wrote:
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
|
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:
|
|||||||||||||||||||
|
compiling SDL codes |
MrOzBarry
|
Did Nikos' last two posts resolve it?
On Fri, Apr 13, 2012 at 1:50 PM, Mohsen Jamali wrote:
|
|||||||||||||||||||||
|
compiling SDL codes |
Mohsen Jamali
Guest
|
what is your compiling command?
On Fri, Apr 13, 2012 at 9:24 PM, Nikos Chantziaras wrote:
|
|||||||||||||||
|
compiling SDL codes |
Mohsen Jamali
Guest
|
wait testing!
On Fri, Apr 13, 2012 at 10:23 PM, Alex Barry wrote:
|
|||||||||||||||||||||||
|
compiling SDL codes |
Mohsen Jamali
Guest
|
it works!
thanks Alex thanks Nikos :-x 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:
|
|||||||||||||||||
|