New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Projucer Linux Makefile Linking error: undefined reference to symbol #499
Comments
Workaround Number 2 (equivalent) Just write I find this workaround more convenient, since Prejuce will make these flags persistent. Hope it helps! |
JUCE contains libpng and builds it as part of I guess we need to make the linker output more verbose to see what other libraries might be pulling the system |
Hi @McMartin thanks for your answer! I do agree, it's kinda weird, but now I'm thinking that I installed Projucer from the Ubuntu repositories, so maybe my Projucer is out of date..? If I run this command in a Linux terminal I'm going to compile Projucer from the last sources, and check if the error remains there. |
Nope... just crashed again.. workaround is the same here: adding the linker flags manually solves the problem. |
Hold on... You were able to build Projucer, but failed to build a new GUI Application? That again doesn't make much sense... I installed Ubuntu 18.10 in a VM (VirtualBox) and I built successfully both Projucer and a new GUI Application. I guess we really need to dig into what the linker is doing on your machine. Please run the following:
and then attach Please also remove the extra linker flags that you added manually from NewProject, try to build it:
and then attach |
Hallo! Here is my link-NewProject.txt file, and here my link-Projucer.txt. Vielen Dank für deine Hilfe! ;) |
Now I'm ever more confused... Your |
Oh that's because Now I run |
OMG, I'm an idiot 🤦♂️ Sorry about that 😅 Please run the following now:
and then attach |
I beg to differ! You're helping me after all.
Done, here is my result: |
Nothing interesting in our Please run the following:
and then you know the drill (for reference: link-NewProject-linker-verbose.txt). |
This one is much longer... 587 lines! :O |
That's actually too short. Your file stops with
but mine goes on and reaches 1275 lines. This seems to mean that something is wrong with the system Here is what I did to get more information about
Please run the same commands (you might have to adapt |
|
Well, I was wrong. If you don't mind, let's try the nuclear solution (:warning: it will produce a very big file: 184 476 lines, 20 MB):
(for reference: link-NewProject-map.txt) |
Ok, I passed the print map Again, thank you very much for the interest! We'll get to the bottom of this! (Er, at this rate.. probably you'll do it first..) |
I don't understand why passing Please run the following commands:
|
Hi! Sorry about the delay.
|
I don't have
when I build with Please run the following:
and then attach |
|
The 2
then please compress |
Hi! Sorry for the delay, I had no internet recently.
|
Which version of JUCE are you using? I assumed you were using 5.4.3 based on
But |
You're right, that could be certainly the problem. I installed JUCE from Ubuntu repositories (5.3.2) and then downloaded Projucer 5.4.3 from https://shop.juce.com/get-juce/download but I cannot delete JUCE 5.3.2. When I try to do it, I can't compile anything. Sorry for the ignorance! But, does that zip file of the Juce Download Page include a 5.4.3 JUCE compiler with the libraries? |
It seems that this is the root cause of all your troubles. I did the following to reproduce:
The When making the /** Debian specific constants
- Debian, we don't use embedded libraries
*/
#ifdef JUCE_INCLUDE_ZLIB_CODE
# undef JUCE_INCLUDE_ZLIB_CODE
#endif
#define JUCE_INCLUDE_ZLIB_CODE 0
#ifdef JUCE_INCLUDE_FLAC_CODE
# undef JUCE_INCLUDE_FLAC_CODE
#endif
#define JUCE_INCLUDE_FLAC_CODE 0
#ifdef JUCE_INCLUDE_OGGVORBIS_CODE
# undef JUCE_INCLUDE_OGGVORBIS_CODE
#endif
#define JUCE_INCLUDE_OGGVORBIS_CODE 0
#ifdef JUCE_INCLUDE_JPEGLIB_CODE
# undef JUCE_INCLUDE_JPEGLIB_CODE
#endif
#define JUCE_INCLUDE_JPEGLIB_CODE 0
#ifdef JUCE_INCLUDE_PNGLIB_CODE
# undef JUCE_INCLUDE_PNGLIB_CODE
#endif
#define JUCE_INCLUDE_PNGLIB_CODE 0
/** Debian specifics END Unfortunately, they didn't change Projucer to make it add the corresponding libraries to the linker flags. Now you have 2 options:
To get the JUCE code without any changes from the Debian Multimedia Maintainers:
|
Just speechless... Alain, thank you so much!! Very attentive, I'll say that for you!
I see.
Any chance of telling them about this? |
First we should check that the problem still exists in the latest version of the package ( |
Actually, this issue seems to be already known and documented in the README of the package: But let's simply ping the maintainer and see what they think. |
if you have problems with the Debian package, you should use the Debian bug-tracker (or Ubuntu's; but I'm not a Ubuntu developer (so i don't follow bug reports there) and the issue really is with the Debian package (as opposed to the same package distributed by any derivative); see [1]), instead of ROLI's issue tracker. having said that, the reasoning why Projucer was not changed to automatically link dynamically against all libraries that JUCE compiles in is that, i tried to avoid overlinking in the first place (and i haven't really investigated in which libraries are really needed by enabling which feature). you are welcome to help with resolving the issue (in the apropriate forum): |
@umlaeute thanks a lot for chiming in! I'll create a bug on the Debian bug-tracker. |
@fbosio feel free to close this issue now. Have fun using JUCE! |
Hi! I created a simple GUI project in Projucer in my Ubuntu 18.10 64 bits system.
When trying to compile such project using
make
, I gotLinking Juce_GUI_Test - App /usr/bin/ld: build/intermediate/Debug/include_juce_graphics_f817e147.o: undefined reference to symbol 'png_set_sBIT@@PNG16_0' /usr/bin/ld: //usr/lib/x86_64-linux-gnu/libpng16.so.16: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make: *** [Makefile:96: build/Juce_GUI_Test] Error 1
I had to add the following flags to the
JUCE_LDFLAGS
macro in theMakefile
in order to make it work:-lpng16 -lz -ljpeg -lFLAC -logg -lvorbis -lvorbisenc -lvorbisfile
The workaround is achieved specifically following these steps:
Makefile
in any text editor you like.JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) $(shell pkg-config --libs alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0) -fvisibility=hidden -lGL -ldl -lpthread -lrt $(LDFLAGS)
should appear.$(LDFLAGS)
so now line 44 should beJUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) $(shell pkg-config --libs alsa freetype2 libcurl x11 xext xinerama webkit2gtk-4.0 gtk+-x11-3.0) -lGL -ldl -lpthread -lrt -lpng16 -lz -ljpeg -lFLAC -logg -lvorbis -lvorbisenc -lvorbisfile $(LDFLAGS)
.make
.I think that it has something to do with function
StringArray getLinkerFlags (const BuildConfiguration& config) const
of the
jucer_ProjectExport_Make
files of the repository.Hope it helps!
The text was updated successfully, but these errors were encountered: