Compiling SDL codes

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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

You need to like with SDL

g++ -o main main.cpp sdl-config --libs --cflags

That should fix you up :slight_smile:
-AlexOn Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks dear Alex :-xOn Sat, Mar 24, 2012 at 1:00 AM, Alex Barry <alex.barry at gmail.com> wrote:

You need to like with SDL

g++ -o main main.cpp sdl-config --libs --cflags

That should fix you up :slight_smile:
-Alex

On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali <@Mohsen_Jamali>wrote:

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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.
-AlexOn Fri, Mar 23, 2012 at 4:40 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

Thanks dear Alex :-x

On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry <@Alex_Barry> wrote:

You need to like with SDL

g++ -o main main.cpp sdl-config --libs --cflags

That should fix you up :slight_smile:
-Alex

On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks again :)On Sat, Mar 24, 2012 at 1:11 AM, Alex Barry <alex.barry at gmail.com> wrote:

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 <@Mohsen_Jamali>wrote:

Thanks dear Alex :-x

On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry <alex.barry at gmail.com> wrote:

You need to like with SDL

g++ -o main main.cpp sdl-config --libs --cflags

That should fix you up :slight_smile:
-Alex

On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali <@Mohsen_Jamali>wrote:

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

No problem, now go have fun with SDL.On Fri, Mar 23, 2012 at 4:43 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

Thanks again :slight_smile:

On Sat, Mar 24, 2012 at 1:11 AM, Alex Barry <@Alex_Barry> wrote:

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 <mohsen.aria at gmail.com>wrote:

Thanks dear Alex :-x

On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry <@Alex_Barry>wrote:

You need to like with SDL

g++ -o main main.cpp sdl-config --libs --cflags

That should fix you up :slight_smile:
-Alex

On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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?
this the sdl-draw library:

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 <alex.barry at gmail.com> wrote:

No problem, now go have fun with SDL.

On Fri, Mar 23, 2012 at 4:43 PM, Mohsen Jamali <@Mohsen_Jamali>wrote:

Thanks again :slight_smile:

On Sat, Mar 24, 2012 at 1:11 AM, Alex Barry <alex.barry at gmail.com> wrote:

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 <@Mohsen_Jamali>wrote:

Thanks dear Alex :-x

On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry <alex.barry at gmail.com>wrote:

You need to like with SDL

g++ -o main main.cpp sdl-config --libs --cflags

That should fix you up :slight_smile:
-Alex

On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali <@Mohsen_Jamali>wrote:

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

What output do you get when you do:
$ sdl-config --cflags

Also, how did you install sdl_draw?

-AlexOn Thu, Apr 12, 2012 at 2:26 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

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?
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 <@Alex_Barry> wrote:

No problem, now go have fun with SDL.

On Fri, Mar 23, 2012 at 4:43 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

Thanks again :slight_smile:

On Sat, Mar 24, 2012 at 1:11 AM, Alex Barry <@Alex_Barry>wrote:

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 <mohsen.aria at gmail.com>wrote:

Thanks dear Alex :-x

On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry <@Alex_Barry>wrote:

You need to like with SDL

g++ -o main main.cpp sdl-config --libs --cflags

That should fix you up :slight_smile:
-Alex

On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali <mohsen.aria at gmail.com wrote:

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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)On 12/04/12 21:26, Mohsen Jamali wrote:

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?

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 typesh ./configure’ instead to prevent csh' from trying to executeconfigure’ 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 thatconfigure’ created (so you can compile the package for
    a different kind of computer), type make distclean'. There is also amake 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 <alex.barry at gmail.com> wrote:

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 <@Mohsen_Jamali>wrote:

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?
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 <alex.barry at gmail.com> wrote:

No problem, now go have fun with SDL.

On Fri, Mar 23, 2012 at 4:43 PM, Mohsen Jamali <@Mohsen_Jamali>wrote:

Thanks again :slight_smile:

On Sat, Mar 24, 2012 at 1:11 AM, Alex Barry <alex.barry at gmail.com>wrote:

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 <@Mohsen_Jamali>wrote:

Thanks dear Alex :-x

On Sat, Mar 24, 2012 at 1:00 AM, Alex Barry <alex.barry at gmail.com>wrote:

You need to like with SDL

g++ -o main main.cpp sdl-config --libs --cflags

That should fix you up :slight_smile:
-Alex

On Fri, Mar 23, 2012 at 4:15 PM, Mohsen Jamali < @Mohsen_Jamali> wrote:

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 toSDL_LockSurface’
main.cpp:(.text+0x43): undefined reference to SDL_GetTicks' main.cpp:(.text+0x100): undefined reference toSDL_UnlockSurface’
main.cpp:(.text+0x124): undefined reference to SDL_UpdateRect' /tmp/ccsRr3LE.o: In functionmain’:
main.cpp:(.text+0x142): undefined reference to SDL_Init' main.cpp:(.text+0x14e): undefined reference toSDL_GetError’
main.cpp:(.text+0x179): undefined reference to SDL_Quit' main.cpp:(.text+0x197): undefined reference toSDL_SetVideoMode’
main.cpp:(.text+0x1af): undefined reference to SDL_GetError' main.cpp:(.text+0x215): undefined reference toSDL_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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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 toDraw_Line’
sdldrawtest.c:(.text+0x47a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4a6): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x4d2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4fe): undefined reference toDraw_Line’
/tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x52a): more undefined references to
Draw_Line' follow /tmp/cc3CtjrF.o: In functionmain’:
sdldrawtest.c:(.text+0x631): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x657): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x67d): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x6c0): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x703): undefined reference to Draw_Circle' /tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x746): more undefined references toDraw_Circle’ follow
/tmp/cc3CtjrF.o: In function main': sdldrawtest.c:(.text+0x789): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x7d2): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x7f8): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x81e): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x84a): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x870): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x89c): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x8c2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x8ee): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x91a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x946): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x972): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x99e): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0x9ca): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x9f6): undefined reference toDraw_HLine’
sdldrawtest.c:(.text+0xa1c): undefined reference to Draw_VLine' sdldrawtest.c:(.text+0xa42): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0xa6e): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xa8e): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xacb): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xb08): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xb45): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xb71): undefined reference toDraw_FillEllipse’
sdldrawtest.c:(.text+0xbba): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xc03): undefined reference toDraw_Round’
sdldrawtest.c:(.text+0xc35): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xc7f): undefined reference toDraw_FillRound’
sdldrawtest.c:(.text+0xcc9): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xcfb): undefined reference toDraw_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:17On Fri, Apr 13, 2012 at 12:32 AM, Nikos Chantziaras wrote:

On 12/04/12 21:26, Mohsen Jamali wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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:43On Fri, Apr 13, 2012 at 12:32 AM, Nikos Chantziaras wrote:

On 12/04/12 21:26, Mohsen Jamali wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Are you compiling this against SDL 1.2 or 1.3/2.0? If 1.2, was it
installed with default settings?
-AlexOn Fri, Apr 13, 2012 at 1:46 AM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

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 toDraw_Line’
sdldrawtest.c:(.text+0x47a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4a6): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x4d2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4fe): undefined reference toDraw_Line’
/tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x52a): more undefined references to
Draw_Line' follow /tmp/cc3CtjrF.o: In functionmain’:
sdldrawtest.c:(.text+0x631): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x657): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x67d): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x6c0): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x703): undefined reference to Draw_Circle' /tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x746): more undefined references toDraw_Circle’ follow
/tmp/cc3CtjrF.o: In function main': sdldrawtest.c:(.text+0x789): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x7d2): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x7f8): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x81e): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x84a): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x870): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x89c): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x8c2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x8ee): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x91a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x946): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x972): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x99e): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0x9ca): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x9f6): undefined reference toDraw_HLine’
sdldrawtest.c:(.text+0xa1c): undefined reference to Draw_VLine' sdldrawtest.c:(.text+0xa42): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0xa6e): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xa8e): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xacb): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xb08): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xb45): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xb71): undefined reference toDraw_FillEllipse’
sdldrawtest.c:(.text+0xbba): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xc03): undefined reference toDraw_Round’
sdldrawtest.c:(.text+0xc35): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xc7f): undefined reference toDraw_FillRound’
sdldrawtest.c:(.text+0xcc9): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xcfb): undefined reference toDraw_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:

On 12/04/12 21:26, Mohsen Jamali wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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/).On 13/04/12 12:38, Mohsen Jamali wrote:

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

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.On 13/04/12 19:54, Nikos Chantziaras wrote:

On 13/04/12 12:38, Mohsen Jamali wrote:

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_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 <alex.barry at gmail.com> wrote:

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 <@Mohsen_Jamali>wrote:

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 toDraw_Line’
sdldrawtest.c:(.text+0x47a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4a6): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x4d2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4fe): undefined reference toDraw_Line’
/tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x52a): more undefined references to
Draw_Line' follow /tmp/cc3CtjrF.o: In functionmain’:
sdldrawtest.c:(.text+0x631): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x657): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x67d): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x6c0): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x703): undefined reference to Draw_Circle' /tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x746): more undefined references toDraw_Circle’ follow
/tmp/cc3CtjrF.o: In function main': sdldrawtest.c:(.text+0x789): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x7d2): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x7f8): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x81e): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x84a): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x870): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x89c): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x8c2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x8ee): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x91a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x946): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x972): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x99e): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0x9ca): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x9f6): undefined reference toDraw_HLine’
sdldrawtest.c:(.text+0xa1c): undefined reference to Draw_VLine' sdldrawtest.c:(.text+0xa42): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0xa6e): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xa8e): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xacb): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xb08): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xb45): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xb71): undefined reference toDraw_FillEllipse’
sdldrawtest.c:(.text+0xbba): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xc03): undefined reference toDraw_Round’
sdldrawtest.c:(.text+0xc35): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xc7f): undefined reference toDraw_FillRound’
sdldrawtest.c:(.text+0xcc9): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xcfb): undefined reference toDraw_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:

On 12/04/12 21:26, Mohsen Jamali wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Did Nikos’ last two posts resolve it?On Fri, Apr 13, 2012 at 1:50 PM, Mohsen Jamali <mohsen.aria at gmail.com>wrote:

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 <@Alex_Barry> wrote:

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 <mohsen.aria at gmail.com>wrote:

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 toDraw_Line’
sdldrawtest.c:(.text+0x47a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4a6): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x4d2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4fe): undefined reference toDraw_Line’
/tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x52a): more undefined references
to Draw_Line' follow /tmp/cc3CtjrF.o: In functionmain’:
sdldrawtest.c:(.text+0x631): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x657): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x67d): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x6c0): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x703): undefined reference to Draw_Circle' /tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x746): more undefined references toDraw_Circle’ follow
/tmp/cc3CtjrF.o: In function main': sdldrawtest.c:(.text+0x789): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x7d2): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x7f8): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x81e): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x84a): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x870): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x89c): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x8c2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x8ee): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x91a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x946): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x972): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x99e): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0x9ca): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x9f6): undefined reference toDraw_HLine’
sdldrawtest.c:(.text+0xa1c): undefined reference to Draw_VLine' sdldrawtest.c:(.text+0xa42): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0xa6e): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xa8e): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xacb): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xb08): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xb45): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xb71): undefined reference toDraw_FillEllipse’
sdldrawtest.c:(.text+0xbba): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xc03): undefined reference toDraw_Round’
sdldrawtest.c:(.text+0xc35): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xc7f): undefined reference toDraw_FillRound’
sdldrawtest.c:(.text+0xcc9): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xcfb): undefined reference toDraw_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:

On 12/04/12 21:26, Mohsen Jamali wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

what is your compiling command?On Fri, Apr 13, 2012 at 9:24 PM, Nikos Chantziaras wrote:

On 13/04/12 12:38, Mohsen Jamali wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

wait testing!On Fri, Apr 13, 2012 at 10:23 PM, Alex Barry <alex.barry at gmail.com> wrote:

Did Nikos’ last two posts resolve it?

On Fri, Apr 13, 2012 at 1:50 PM, Mohsen Jamali <@Mohsen_Jamali>wrote:

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 <alex.barry at gmail.com> wrote:

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 <@Mohsen_Jamali>wrote:

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 toDraw_Line’
sdldrawtest.c:(.text+0x47a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4a6): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x4d2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x4fe): undefined reference toDraw_Line’
/tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x52a): more undefined references
to Draw_Line' follow /tmp/cc3CtjrF.o: In functionmain’:
sdldrawtest.c:(.text+0x631): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x657): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x67d): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x6c0): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x703): undefined reference to Draw_Circle' /tmp/cc3CtjrF.o:sdldrawtest.c:(.text+0x746): more undefined references toDraw_Circle’ follow
/tmp/cc3CtjrF.o: In function main': sdldrawtest.c:(.text+0x789): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x7d2): undefined reference to Draw_Circle' sdldrawtest.c:(.text+0x7f8): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x81e): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x84a): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x870): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x89c): undefined reference toDraw_Circle’
sdldrawtest.c:(.text+0x8c2): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x8ee): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x91a): undefined reference to Draw_Line' sdldrawtest.c:(.text+0x946): undefined reference toDraw_Line’
sdldrawtest.c:(.text+0x972): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x99e): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0x9ca): undefined reference to Draw_Rect' sdldrawtest.c:(.text+0x9f6): undefined reference toDraw_HLine’
sdldrawtest.c:(.text+0xa1c): undefined reference to Draw_VLine' sdldrawtest.c:(.text+0xa42): undefined reference toDraw_Rect’
sdldrawtest.c:(.text+0xa6e): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xa8e): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xacb): undefined reference to Draw_Pixel' sdldrawtest.c:(.text+0xb08): undefined reference toDraw_Pixel’
sdldrawtest.c:(.text+0xb45): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xb71): undefined reference toDraw_FillEllipse’
sdldrawtest.c:(.text+0xbba): undefined reference to Draw_Ellipse' sdldrawtest.c:(.text+0xc03): undefined reference toDraw_Round’
sdldrawtest.c:(.text+0xc35): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xc7f): undefined reference toDraw_FillRound’
sdldrawtest.c:(.text+0xcc9): undefined reference to Draw_Round' sdldrawtest.c:(.text+0xcfb): undefined reference toDraw_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:

On 12/04/12 21:26, Mohsen Jamali wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

it works!
thanks Alex :-x
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:1On Fri, Apr 13, 2012 at 9:29 PM, Nikos Chantziaras wrote:

On 13/04/12 19:54, Nikos Chantziaras wrote:

On 13/04/12 12:38, Mohsen Jamali wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org