Install SDL on Linux/ubuntu

本文详细介绍了如何安装和配置SDL库,包括编译、安装步骤及如何在项目中使用SDL进行基本操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


http://www.libsdl.org/


To compile and install SDL:

    1.  Run './configure; make; make install'

        If you are compiling for Windows using gcc, read the FAQ at:
        http://www.libsdl.org/faq.php?action=listentries&category=4#42

        If you are compiling using Visual C++ on Win32, you should read
        the file VisualC.html

    2.  Look at the example programs in ./test, and check out the HTML
        documentation in ./docs to see how to use the SDL library.

    3.  Join the SDL developer mailing list by sending E-mail to
        sdl-request@libsdl.org
        and put "subscribe" in the subject of the message.

        Or alternatively you can use the web interface:
            http://www.libsdl.org/mailing-list.php

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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 the `-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.
----------------------------------------------------------------------
/bin/bash ./libtool --mode=install /usr/bin/install -c build/libSDLmain.la /usr/local/lib/libSDLmain.la
libtool: install: /usr/bin/install -c build/.libs/libSDLmain.lai /usr/local/lib/libSDLmain.la
libtool: install: /usr/bin/install -c build/.libs/libSDLmain.a /usr/local/lib/libSDLmain.a
libtool: install: chmod 644 /usr/local/lib/libSDLmain.a
libtool: install: ranlib /usr/local/lib/libSDLmain.a
libtool: finish: PATH="/opt/ros/fuerte/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/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 the `-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.
----------------------------------------------------------------------
/bin/bash build-scripts/mkinstalldirs /usr/local/share/aclocal
mkdir -p -- /usr/local/share/aclocal
/usr/bin/install -c -m 644 ./sdl.m4 /usr/local/share/aclocal/sdl.m4
/bin/bash build-scripts/mkinstalldirs /usr/local/lib/pkgconfig
/usr/bin/install -c -m 644 sdl.pc /usr/local/lib/pkgconfig
/bin/bash build-scripts/mkinstalldirs /usr/local/share/man/man3
for src in ./docs/man3/*.3; do \
        file=`echo $src | sed -e 's|^.*/||'`; \
        /usr/bin/install -c -m 644 $src /usr/local/share/man/man3/$file; \
    done

好烦人的系统依赖性关系检查。。 cat@lubancat:~/work/lvgl/demo_linux_port_sdl$ cmake -B ./build -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:13 (find_package): By not providing "FindSDL2_image.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SDL2_image", but CMake did not find one. Could not find a package configuration file provided by "SDL2_image" with any of the following names: SDL2_imageConfig.cmake sdl2_image-config.cmake Add the installation prefix of "SDL2_image" to CMAKE_PREFIX_PATH or set "SDL2_image_DIR" to a directory containing one of the above files. If "SDL2_image" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/cat/work/lvgl/demo_linux_port_sdl/build/CMakeFiles/CMakeOutput.log". cat@lubancat:~/work/lvgl/demo_linux_port_sdl$ cmake --build ./build make: *** No targets specified and no makefile found. Stop. cat@lubancat:~/work/lvgl/demo_linux_port_sdl$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal cat@lubancat:~/work/lvgl/demo_linux_port_sdl$
最新发布
06-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值