Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Cmake does not find SDL2 #10

Open
ekianjo opened this issue Sep 24, 2016 · 5 comments
Open

Cmake does not find SDL2 #10

ekianjo opened this issue Sep 24, 2016 · 5 comments

Comments

@ekianjo
Copy link

ekianjo commented Sep 24, 2016

Even though it's installed as libsdl2-2.0-0 on my system (Mint 17.3)
ANything I can do about that?

@KoKuToru
Copy link
Owner

you will need to install libsdl2-dev .. but I am not sure if it installs the 32Bit-version too

@wberrier
Copy link

wberrier commented Dec 5, 2016

At least on Fedora, I also had to set PKG_CONFIG_PATH to contain the 32bit version of the headers.

@cdelorme
Copy link

cdelorme commented Jan 7, 2017

I am running debian jessie and ran into this problem too.

The 64 and 32 bit versions of SDL2 conflict; installing one will uninstall the other.

I use multiple applications that depend on the 64 bit libsdl2 package.

Fortunately, I could work around this by downloading the source and compiling it.

Unfortunately, SDL2 documentation is completely worthless in regards to having any form of instruction compiling for 32 bit.

There are at least a dozen wrong ways to do it, here is what worked for me:

mkdir build_i386
cd build_i386
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 ../configure --build=i386-linux
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make
sudo make install
sudo ldconfig

The last step (ldconfig) adds it to the linker, and you can verify that it's a 32bit version by running ldconfig -p | grep SDL2.

Afterwards I was able to build koku-xinput-wine following the readme.

I hope this helps solve your problem and that it saves others time/effort trying to figure it out.

@KoKuToru this utility is awesome! Thank you so much for creating and sharing it.

@GCAT01
Copy link

GCAT01 commented Aug 11, 2017

@cdelorme I am trying your fix but am a total n00b to all this. Where does one get the source for the 32 bit package? I keep finding pre-compiled versions.

Also, do you have to put the source file anywhere in particular?

@cdelorme
Copy link

@YalithKBK it's the same source code, you are simply instructing the compiler to compile for a 32 bit platform as opposed to 64 bit. **This is done by adding --build=i386-linux when running ./configure, but also by setting the CFLAGS, CXXFLAGS, and LDFLAGS accordingly so that everything else also compiles correctly.

The build_i386 folder is an arbitrary way of separating a 32 bit build from a 64 bit build, if you happen to build both which I did when testing.

I am also somewhat of a noob when it comes to the linker, but I believe ldconfig is refreshing the index of shared libraries, so while the file may have been correctly installed no other applications will see or connect to it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants