Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

i'm struggling in the attept to compile c++ with SDL2. I've done as always:

  1. checkout the code (both from mercurial and libsdl.org)
  2. ./configure, make, sudo make install

But it keeps to say:

/usr/bin/ld: error: cannot find -lSDL2

I need to get working on my source code quickly and on 13.04 and 13.10 these operations always led me to working libs. Now back on 12.04 something strange is happening. Also the make install instructions said:

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'

can someone please elaborate a little bit on these instructions, since i don't seem to get it?

echoing both variables shows they're empty, also i'm on a 64 bit version of 12.04 (it must matter since on both 13.04/13.10 no problems at all)

share|improve this question

1 Answer 1

First, run:

$ ./configure

Then create a directory and go into it:

$ md build && cd ./build

Then run make:

$ ../make

Finally, install it:

$ sudo ../make install

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.