How can I fix the library error for SDL on SUSE with KDevelop?

  • Thread starter dmail
  • Start date
In summary, The conversation discusses the issue the person is facing while trying to compile a cross-platform game using SDL on a nix system. The person is getting an error related to the library libstdc++.la and has tried various methods to resolve it, such as adding the library path to the makefile and editing d.so.conf. However, they were unable to find a solution and ended up reinstalling the operating system. After the reinstallation, they encounter a new error related to the library -lslang and are seeking help to resolve it.
  • #1
dmail
19
0
Im new to developing on nix and I am trying to make a cross platform game using sdl., i set up sdl using the dev rpm but I am getting an error when trying to compile
error:
libtool: link: cannot find the library `/usr/local/lib/libstdc++.la'

this file is in /usr/lib/ which i would assume the the defaullt directory?

i have tried adding
sdl_test_2_LDFLAGS = $(all_libraries) -l/usr/lib -l/usr/lib/GL
(where sdl_test_2 is the apps name)
to the makefile but it still can't find it. any help would be appriacted, if you need more details i will post.
cheers
 
Last edited:
Technology news on Phys.org
  • #2
Here is a guide:

http://gpwiki.org/index.php/C:How_to_set_up_your_SDL_Build_Environment#Linux:_KDevelop

It might also be that your missing some dependences, but try following the guide first and then come back if it doesn't work out.
 
Last edited by a moderator:
  • #3
dduardo said:
Here is a guide:

http://gpwiki.org/index.php/C:How_to_set_up_your_SDL_Build_Environment#Linux:_KDevelop

It might also be that your missing some dependences, but try following the guide first and then come back if it doesn't work out.
thanks for the link dduardo from what i read of this forum so far, it was you i was looking a reply from ':) cheers
 
Last edited by a moderator:
  • #4
hmm still no joy.
i don't understand it(mind you there's plenty of visual studio errors i don't get), coz you can see the directory /usr/lib in included as a path?

i have even tried #pragma comment (lib,"/usr/lib/libstdc++.la") to no avail

linker output:
cd '/home/dmail/projects/sdl_test_03/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
gmake all-recursive
gmake[1]: Entering directory `/home/dmail/projects/sdl_test_03/debug'
Making all in src
gmake[2]: Entering directory `/home/dmail/projects/sdl_test_03/debug/src'
cd /home/dmail/projects/sdl_test_03 && /bin/sh /home/dmail/projects/sdl_test_03/missing --run automake-1.9 --gnu src/Makefile
cd .. && /bin/sh ./config.status src/Makefile depfiles
config.status: creating src/Makefile
config.status: executing depfiles commands
gmake[2]: Leaving directory `/home/dmail/projects/sdl_test_03/debug/src'
gmake[2]: Entering directory `/home/dmail/projects/sdl_test_03/debug/src'
/bin/sh ../libtool --tag=CXX --mode=link g++ -O0 -g3 -lSDL_mixer -o sdl_test_03 -R/usr/lib /usr/lib/ sdl_test_03.o -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread
libtool: link: cannot find the library `/usr/local/lib/libstdc++.la'
gmake[2]: *** [sdl_test_03] Error 1
gmake[2]: Target `all' not remade because of errors.
gmake[2]: Leaving directory `/home/dmail/projects/sdl_test_03/debug/src'
gmake[2]: Entering directory `/home/dmail/projects/sdl_test_03/debug'
gmake[2]: Leaving directory `/home/dmail/projects/sdl_test_03/debug'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/dmail/projects/sdl_test_03/debug'
gmake: *** [all] Error 2
*** Exited with status: 2 ***
 
Last edited:
  • #5
libtool: link: cannot find the library `/usr/local/lib/libstdc++.la'

This rpm package has libstdc++.la as one of the libs it installs.
 
  • #6
ranger said:
This rpm package has libstdc++.la as one of the libs it installs.
i have the lib, but its in the what i would have thought the default file /usr/lib/

due to advice i have since
edited d.so.conf and added /usr/lib before /usr/local/lib . then, run ldconfig as root (although i don't know if this did anything?)with no parameters.
 
Last edited:
  • #7
ok i couldn't find anybody who could give me a reason or a method of fixing this error so i reinstalled the whole os (drastic i know) and this get rid of that error :)
but this means i now get another error :(
i have no prob compiling a simple c++ app, but when i try and compile an sdl app this is the error:
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld: cannot find -lslang
the full output is
cd '/home/dmail/projects/sdl_001' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -f Makefile.cvs && cd '/home/dmail/projects/sdl_001/debug' && CXXFLAGS="-O0 -g3" "/home/dmail/projects/sdl_001/configure" --enable-debug=full && cd '/home/dmail/projects/sdl_001/debug/src' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k sdl_001
aclocal
configure.in:12: warning: underquoted definition of KDE_FIND_PATH
run info '(automake)Extending aclocal'
or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
acinclude.m4:12: warning: underquoted definition of AM_PATH_SDLMM
autoheader
automake
autoconf
installing -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/i586-suse-linux/bin/ld
checking if the linker (/usr/i586-suse-linux/bin/ld) is GNU ld... yes
checking for /usr/i586-suse-linux/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
compiling yes (gcc)
checking whether the gcc linker (/usr/i586-suse-linux/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics...
cat: /etc/ld.so.conf.d/*.conf: No such file or directory
GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/i586-suse-linux/bin/ld
checking if the linker (/usr/i586-suse-linux/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/i586-suse-linux/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
compiling yes (g++)
checking whether the g++ linker (/usr/i586-suse-linux/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics...
cat: /etc/ld.so.conf.d/*.conf: No such file or directory
GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
checking for sdl-config... /usr/bin/sdl-config
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
compiling sdl_001.cpp (g++)
linking sdl_001 (libtool)
mkdir .libs
linking sdl_001 (g++)
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld: cannot find -lslang
collect2: ld returned 1 exit status
gmake: *** [sdl_001] Error 1
*** Exited with status: 2 ***
does anybody know how i can compile an sdl app without getting errors(regretably windows has no probs :( )
 
Last edited by a moderator:
  • #8
update:
finally got sdl to work after installing slang-devel. ;)
 
  • #9
I am glad I stumbled on this thread. I had tried to compile some basic SDL programs using KDevelop for a couple of weeks without any luck. I had the same error "/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld: cannot find -lslang" and had given up on it because I could get it to work using the command line with g++ using the -lSDL flag. I just downloaded the slang-devel package and now it works with KDevelop. I had always thought that KDevelop was just a frontend for gcc/g++.
Thank you very much for the information.
Eric :smile:
 

1. How do I install SDL on SUSE with KDevelop?

To install SDL on SUSE with KDevelop, you will need to use your package manager to download and install the SDL development libraries. In SUSE, this can be done using the zypper command in the terminal. Once the libraries are installed, you can then configure your KDevelop project to use them.

2. What is SDL and why is it used with KDevelop?

SDL (Simple DirectMedia Layer) is a cross-platform development library that provides low-level access to graphics, audio, and input devices. It is commonly used with KDevelop, an integrated development environment (IDE), to create multimedia applications and games.

3. Can I use SDL with other programming languages on SUSE?

Yes, SDL can be used with a variety of programming languages on SUSE, including C, C++, Java, and Python. It is a popular choice for multimedia development due to its cross-platform compatibility and ease of use.

4. Are there any tutorials or resources available for using SDL with KDevelop on SUSE?

Yes, there are many tutorials and resources available online for using SDL with KDevelop on SUSE. Some recommended resources include the official SDL documentation, the KDevelop user manual, and various online forums and communities for developers using SDL and KDevelop.

5. Can I use SDL with KDevelop to create mobile applications?

Yes, SDL can be used with KDevelop to create mobile applications for Android and iOS devices. However, additional steps and configurations may be required depending on the target platform and device. It is recommended to consult the official documentation and resources for specific instructions on mobile development with SDL and KDevelop.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
893
  • Programming and Computer Science
Replies
6
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top