我是靠谱客的博主 含糊外套,最近开发中收集的这篇文章主要介绍SDL_draw的安装配置(Ubuntun10.04),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

在Google上查找相关SDL_draw的安装,发现试了很多个都不行,于是自己尝试摸索。

步骤如下:

1. 下载SDL_draw(SDL_draw-1.2.13.tar.gz)开源包(http://sdl-draw.sourceforge.net/)

2. 编译,安装开源包

sudo ./configure

loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal-1.4... missing
checking for working autoconf... found
checking for working automake-1.4... missing
checking for working autoheader... found
checking for working makeinfo... missing
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for ranlib... (cached) ranlib
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for ld used by GCC... (cached) /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes
checking for BSD-compatible nm... (cached) /usr/bin/nm -B
checking whether ln -s works... (cached) yes
loading cache ./config.cache within ltconfig
checking for object suffix... o
checking for executable suffix... (cached) no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions ... no
checking if gcc static flag -static works... -static
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the linker (/usr/bin/ld) supports shared libraries... yes
checking command to parse /usr/bin/nm -B output... ok
checking how to hardcode library paths into programs... immediate
checking for /usr/bin/ld option to reload object files... -r
checking dynamic linker characteristics... Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
loading cache ./config.cache
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -g -O2 ) works... yes
checking whether the C compiler (gcc -g -O2 ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for ranlib... (cached) ranlib
checking target system type... i686-pc-linux-gnu
checking for sdl-config... (cached) /usr/bin/sdl-config
checking for SDL - version >= 1.2.0... yes
creating ./config.status
creating Makefile
creating src/Makefile

sudo make

Making all in src
make[1]: Entering directory `/home/fangl/SDL_draw-1.2.13/src'
/bin/sh ../libtool --mode=compile gcc -DPACKAGE="SDL_draw" -DVERSION="1.2.1"  -I. -I.  `sdl-config --cflags` -I../include     -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -c SDL_draw.c
rm -f .libs/SDL_draw.lo
gcc -DPACKAGE="SDL_draw" -DVERSION="1.2.1" -I. -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I../include -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -Wp,-MD,.deps/SDL_draw.pp -c SDL_draw.c  -fPIC -DPIC -o .libs/SDL_draw.lo
gcc -DPACKAGE="SDL_draw" -DVERSION="1.2.1" -I. -I. -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I../include -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -Wp,-MD,.deps/SDL_draw.pp -c SDL_draw.c -o SDL_draw.o >/dev/null 2>&1
mv -f .libs/SDL_draw.lo SDL_draw.lo
/bin/sh ../libtool --mode=link gcc  -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -o libSDL_draw.la -rpath /usr/local/lib -release 1.2    -version-info 0:1:0                              SDL_draw.lo  -L/usr/lib -lSDL
rm -fr .libs/libSDL_draw.la .libs/libSDL_draw.* .libs/libSDL_draw-1.2.*
gcc -shared  SDL_draw.lo  -L/usr/lib -lSDL -lc  -Wl,-soname -Wl,libSDL_draw-1.2.so.0 -o .libs/libSDL_draw-1.2.so.0.0.1
(cd .libs && rm -f libSDL_draw-1.2.so.0 && ln -s libSDL_draw-1.2.so.0.0.1 libSDL_draw-1.2.so.0)
(cd .libs && rm -f libSDL_draw.so && ln -s libSDL_draw-1.2.so.0.0.1 libSDL_draw.so)
ar cru .libs/libSDL_draw.a  SDL_draw.o
ranlib .libs/libSDL_draw.a
creating libSDL_draw.la
(cd .libs && rm -f libSDL_draw.la && ln -s ../libSDL_draw.la libSDL_draw.la)
make[1]: Leaving directory `/home/fangl/SDL_draw-1.2.13/src'
make[1]: Entering directory `/home/fangl/SDL_draw-1.2.13'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/home/fangl/SDL_draw-1.2.13'

sudo make install

Making install in src
make[1]: Entering directory `/home/fangl/SDL_draw-1.2.13/src'
make[2]: Entering directory `/home/fangl/SDL_draw-1.2.13/src'
/bin/sh ../mkinstalldirs /usr/local/lib
/bin/sh ../libtool  --mode=install /usr/bin/install -c libSDL_draw.la /usr/local/lib/libSDL_draw.la
/usr/bin/install -c .libs/libSDL_draw-1.2.so.0.0.1 /usr/local/lib/libSDL_draw-1.2.so.0.0.1
(cd /usr/local/lib && rm -f libSDL_draw-1.2.so.0 && ln -s libSDL_draw-1.2.so.0.0.1 libSDL_draw-1.2.so.0)
(cd /usr/local/lib && rm -f libSDL_draw.so && ln -s libSDL_draw-1.2.so.0.0.1 libSDL_draw.so)
/usr/bin/install -c .libs/libSDL_draw.lai /usr/local/lib/libSDL_draw.la
/usr/bin/install -c .libs/libSDL_draw.a /usr/local/lib/libSDL_draw.a
ranlib /usr/local/lib/libSDL_draw.a
chmod 644 /usr/local/lib/libSDL_draw.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/fangl/SDL_draw-1.2.13/src'
make[1]: Leaving directory `/home/fangl/SDL_draw-1.2.13/src'
make[1]: Entering directory `/home/fangl/SDL_draw-1.2.13'
make[2]: Entering directory `/home/fangl/SDL_draw-1.2.13'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/fangl/SDL_draw-1.2.13'

make[1]: Leaving directory `/home/fangl/SDL_draw-1.2.13'

这样SDL_draw开源包就安装成功了

注意:按照如上进行编译安装之后的文件存放在默认目录:/usr/local/lib

安装文件:

libSDL_draw-1.2.so.0      libSDL_draw.a   libSDL_draw.so

libSDL_draw-1.2.so.0.0.1  libSDL_draw.la 

3. 环境配置

在这里,我将以上5个文件libSDL_draw*拷贝到/usr/lib下。(why?因为sdl的libSDL_image,libSDL_gfx等都在这个目录下,不用编译时和sdl的路径不一样)

注意:网上export添加路径为临时路径,而且还要把此路径加入到如上编译命令中去,麻烦。

4. 最后不要忘记添加SDL_draw.h

如上编译安置,配置之后,还缺少一个文件——SDL_draw.h,此文件网上去找。最后将SDL_draw.h拷贝到/usr/include/SDL目录里。

编译运行:g++ -o temp temp.cpp `sdl-config --cflags --libs` -lSDL_draw









最后

以上就是含糊外套为你收集整理的SDL_draw的安装配置(Ubuntun10.04)的全部内容,希望文章能够帮你解决SDL_draw的安装配置(Ubuntun10.04)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部