Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Getting undefined reference LIBJPEG_8  (Read 2275 times)

0 Members and 1 Guest are viewing this topic.

jalf86

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Getting undefined reference LIBJPEG_8
« on: May 26, 2017, 05:36:01 pm »
Not sure if I got the error message correct.  Please correct me if I am wrong.

This isn't a asking for help post.  Its an answer post, for other newbies like me, so that they don't have to go through the nightmare I went through of searching and failing.

I'm using Linux/Fedora 25 and Code::Blocks IDE.

I've been having problems compiling anything that calls SFML.  I'm getting undefined reference errors. So I decided to compile SFML from source.

I found most everything I needed within a few minutes with the commands:

dnf whatprovides <the file I need or symbol I need> 
dnf install <the package I need>

(Have to run the above commands as root)

The big bear of a problem to find was LIBJPEG_8.  Fedora 25 uses a package called libjpeg-turbo to implement the libjpeg library.  This library emulates libjpeg v8.  So it doesn't have the libjpeg libraries SFML needs.  Also, it seems that libjpeg v8 is emulated in a lot of other distros.  So the file libjpeg.so.8 that SFML needs was seeminly nowhere to be found.  After days of searching, I found it in

https://rpmfind.net/linux/RPM/mageia/1/x86_64/media/core/updates/lib64jpeg8-8b-5.1.mga1.x86_64.html

When you want to find a file SFML needs;

https://www.rpmfind.net/

is your friend.

I hope this post helps many others.
« Last Edit: May 26, 2017, 06:28:00 pm by jalf86 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Re: Getting undefined reference LIBJPEG_8
« Reply #1 on: May 27, 2017, 10:47:56 am »
If you rebuild SFML from source it should be able to find libjpeg-turbo as well, otherwise you can eithet just edit the lib location in CMake's advanced variable option or make a sym link to the jpeg-turbo lib.

Using the SFML version provided by thr package manager will probably be the best way, unless you need the latest changes to SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jalf86

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Getting undefined reference LIBJPEG_8
« Reply #2 on: May 29, 2017, 01:16:29 pm »
Still a newb at this.  libjpeg-turbo just doesn't have libjpeg.so.8, so I don't think pointing to its lib directory would do any good.  As for a symbolic link, if i understand correctly that would be the same as a reference (in C++).  So would I type the following, for a symbolic link?

ln -s /file/path/<file that emulates libjpeg.so.8> libjpeg.so.8

Then I could build from source just like normal?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Re: Getting undefined reference LIBJPEG_8
« Reply #3 on: May 29, 2017, 02:11:19 pm »
jpeg-turbo is fully compatible with jpeg v8, so you can use it as drop-in replacement (which is already done on some systems).
You really should just be able to build SFML from source and the CMake modules should automatically find the right version of JPEG.

A quick search showed that Fedora does have a libjpeg package, even though it's marked as retired, so it's not served anymore?
The SFML version for Fedora 25 seems to be at 2.3.2

And you can look up the syntax for a sym link in the man page. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/