/usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
drpurpul
Posts: 10
Joined: 24 Dec 2017, 13:41
Github profile: http://github.com/andras-kiss

/usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by drpurpul » 24 Dec 2017, 14:24

I get this error while compiling openmw 0.43.0 on debian stretch:

Code: Select all

[email protected]:~/openmw/build$ make
[  0%] Built target osg-ffmpeg-videoplayer
[  0%] Built target local_tinyxml
[  1%] Built target oics
[  2%] Built target osgQt
-- OpenMW version 0.43.0
[  2%] Built target git-version
[ 24%] Built target components
[ 24%] Linking CXX executable ../../openmw
/usr/local/lib/libSDL2.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
apps/openmw/CMakeFiles/openmw.dir/build.make:6535: recipe for target 'openmw' failed
make[2]: *** [openmw] Error 1
CMakeFiles/Makefile2:437: recipe for target 'apps/openmw/CMakeFiles/openmw.dir/all' failed
make[1]: *** [apps/openmw/CMakeFiles/openmw.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
[email protected]:~/openmw/build$ 
Please help.

User avatar
akortunov
Posts: 474
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation
Github profile: https://github.com/akortunov

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by akortunov » 24 Dec 2017, 14:41

Looks like you are trying to compile 64-bit OpenMW with 32-bit SDL, or 32-bit OpenMW with 64-bit SDL.

drpurpul
Posts: 10
Joined: 24 Dec 2017, 13:41
Github profile: http://github.com/andras-kiss

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by drpurpul » 24 Dec 2017, 15:03

I have 64 bit sdl:

Code: Select all

[email protected]:~$ dpkg -l | grep sdl
ii  libsdl-image1.2:amd64                        1.2.12-5+b8                                 amd64        Image loading library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl-mixer1.2:amd64                        1.2.12-11+b3                                amd64        Mixer library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl-ttf2.0-0:amd64                        2.0.11-3+b1                                 amd64        TrueType Font library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl1.2debian:amd64                        1.2.15+dfsg1-4                              amd64        Simple DirectMedia Layer
ii  libsdl2-2.0-0:amd64                          2.0.5+dfsg1-2                               amd64        Simple DirectMedia Layer
ii  libsdl2-dev                                  2.0.5+dfsg1-2                               amd64        Simple DirectMedia Layer development files
How do I build 64bit openmw?

drpurpul
Posts: 10
Joined: 24 Dec 2017, 13:41
Github profile: http://github.com/andras-kiss

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by drpurpul » 24 Dec 2017, 15:06

On github I see that openmw now uses libsdl 2.0.7. Maybe that's the problem? I have the distribution version for debian 9 (2.0.4).

drpurpul
Posts: 10
Joined: 24 Dec 2017, 13:41
Github profile: http://github.com/andras-kiss

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by drpurpul » 24 Dec 2017, 15:23

libsdl version was the problem. I did a make and make install of libsdl 2.0.7, and it compiled successfully. Was debian 9 given up on?

User avatar
akortunov
Posts: 474
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation
Github profile: https://github.com/akortunov

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by akortunov » 24 Dec 2017, 15:29

drpurpul wrote:
24 Dec 2017, 15:23
I did a make and make install of libsdl 2.0.7, and it compiled successfully.
Do not use the "make install" on Linux: it may lead to troubles if you will decide to upgrade/remove installed package.
Usually you can use packages from testing repos, or build and install your own package for your distro (via checkinstall, for example).

User avatar
akortunov
Posts: 474
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation
Github profile: https://github.com/akortunov

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by akortunov » 24 Dec 2017, 15:31

drpurpul wrote:
24 Dec 2017, 15:06
I have the distribution version for debian 9 (2.0.4).
Actually, 2.0.5, judging by your dpkg output.

drpurpul
Posts: 10
Joined: 24 Dec 2017, 13:41
Github profile: http://github.com/andras-kiss

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by drpurpul » 24 Dec 2017, 15:39

Thank you for the responses. If I install from testing won't that be just as bad? I want to learn more about linux, that's why I'm asking. Thank you for any advice.

User avatar
akortunov
Posts: 474
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation
Github profile: https://github.com/akortunov

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by akortunov » 24 Dec 2017, 15:51

drpurpul wrote:
24 Dec 2017, 15:39
If I install from testing won't that be just as bad?
Definely better than "make install".
Generally, you should build your own package (*.deb in your case) only if there are no suitable packages in repos.

FYI: recently one guy failed to compile OpenMW, because he had two versions of OSG installed: one from repos, and one installed via "make install" a long time ago.

drpurpul
Posts: 10
Joined: 24 Dec 2017, 13:41
Github profile: http://github.com/andras-kiss

Re: /usr/local/lib/libSDL2.so: error adding symbols: File in wrong format

Post by drpurpul » 24 Dec 2017, 16:03

How do I remove libsdl 2.0.7 I just make installed? By manually deleting it?

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests