• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 2 3 4 5 6 ... 115 Next »

Compiling Dolphin and libpng's version
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Compiling Dolphin and libpng's version
01-22-2021, 10:49 PM
#1
Espyo Offline
Junior Member
**
Posts: 1
Threads: 1
Joined: Jan 2021
I'm trying to compile Dolphin on Lubuntu 16.04. Despite many hiccups at first, I was able to get to the part where I just need to run make. Unfortunately, compilation fails with errors along the lines of:
Code:
.../Source/Core/Common/Image.cpp:23:3: error: ‘png_image’ was not declared in this scope; did you mean ‘png_time’?
From searching online, it looks like my problem is the version of libpng -- Dolphin requires libpng 1.6 or newer, and I'm running 1.2.54.

First, I tried installing 1.6, and while that did alleviate some of the PNG errors, compilation still fails with most of them. I ran convert -list format | grep PNG, but it's clear that it was still trying to use 1.2.54. Then, I tried removing 1.2.54, but so many packages in my system depend on it that if I were to do that, I'd turn it into a brick.

Later, I tried downloading libpng and compiling it myself. I succeeded, but have no idea how to get Dolphin to use my compiled version instead of the system's. In my research, I realized Dolphin's source already has the required libpng files in the Externals folder, but I have no idea how to get Dolphin to use those either. I did try editing CMakeLists.txt in order to comment out the lines about the shared libpng, and to keep only the lines about the static libpng from Externals, but it didn't make a difference.

Is there something I'm missing? Is it even possible for me to compile Dolphin using libpng 1.6 in my circumstances? On a similar note, I'm only compiling it by hand because the Dolphin PPA hasn't had a working version for Ubuntu 16 in years now. So if anyone knows what's up with that, that would honestly be pretty nice too. Thanks!
Find
Reply
09-20-2021, 04:08 AM
#2
Ahab Offline
Junior Member
**
Posts: 1
Threads: 0
Joined: Sep 2021
I've had the same issue. If you look in CMakeLists.txt, around line 690, it configures which libpng to use. I got it to work by deleting the lines where it was looking for my system png and rebuilding. So instead of

if(NOT APPLE)
check_lib(PNG libpng png png.h QUIET)
endif()
if (PNG_FOUND)
message(STATUS "Using shared libpng")
else()
check_vendoring_approved(libpng)
message(STATUS "Using static libpng from Externals")
add_subdirectory(Externals/libpng)
set(PNG png)
endif()


It looks like

check_vendoring_approved(libpng)
message(STATUS "Using static libpng from Externals")
add_subdirectory(Externals/libpng)
set(PNG png)

This will force it to use the lib packaged with the build. Not saying it's the best solution, but it worked for me.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode