Pencil: errors linking to QT5 static librarys while building from source

Created on 11 Jul 2016  路  7Comments  路  Source: pencil2d/pencil

I've been working on building Pencil2D from source and trying to sort out my system specific errors along the way. My current issue involves the Makefile trying to link to qt5 static libraries that just don't exist in the library path.
I'm building the program on my Linux Mint 17.2 OS with a non-standard qt5 library that I downloaded from the QT website and saved to my home directory. The Makefile was generated from running qmake on the pencil.pro file inside my local copy of the Pencil2D source, and the error seems to occurs when g++ executes these parameters for linking the object files:
LIBS = $(SUBLIBS) -L/home/gerg/Pencil2D_Sources/pencil/app/../core_lib/ -lcore_lib -L/home/gerg/Pencil2D_Sources/pencil/app/../3rdlib/quazip/ -lquazip -L/home/gerg/Pencil2D_Sources/pencil/app/../3rdlib/zlib/ -lzlib -L/home/gerg/qt5/5.6/gcc_64/lib -lQt5Svg -lQt5Widgets -lQt5Multimedia -lQt5Gui -lQt5Xml -lQt5Network -lQt5Core -lGL -lpthread
The error messages that result include and resemble the following:_
bezierarea.cpp:(.text+0x3b6): undefined reference toQString::free(QString::Data*)` It appears that g++ is trying to link the source code to static libraries liblQt5Svg.a, liblQt5Widgets.a, lQt5Multimedia.a, and so on with the-lQt5Svg -lQt5Widgets -lQt5Multimedia...` options, but those files simply don't exist in my Qt5 library. However, none of these files exist in my standard qt5 library either, so my question is where do I approach this error from? I suspect that there is some failure on my part to properly install the qt5 libraries somehow, but I haven't had luck finding answers recently.

I apologize if this is the wrong place for this topic

thanks,
greg

Compilation Linux

Most helpful comment

I've successfully built the source code on fedora linux. Installed the following packages:
zlib zlib-devel qt5-qtsvg-devel qt5-qtsvg qt5-qtxmlpatterns qt5-qtxmlpatterns-devel qt5-qtmultimedia qt5-qtmultimedia-devel

All 7 comments

@GregorysonofCarl I think it's a good place for the topic, since this can be helpful for other future developers, however I have no idea how to fix this, maybe @chchwy who is the lead developer can help you further with this issue.

Hi @GregorysonofCarl
I have to say sorry first that I have only limited experiences on Linux.

But in this case, the .a files such like libQt5Widgets.a must exist when you build Qt as a static library, I have no idea why they don't exist.

Maybe @feeef could help you?

Hi @GregorysonofCarl,
I am personally using Debian but Mint should be pretty close to it in term of packages.

In order to have a working dev environment I just install the main QT dev packages :

sudo apt-get install qt5-default qtcreator

Plus the following libs :

sudo apt-get install qtmultimedia5-dev libqt5xmlpatterns5-dev libqt5svg5-dev zlib1g-dev

I hope it helps!

Hello everyone,
Thank you all for your replies.

@feeef, I double checked that all the suggested QT dev packages were installed and I cleaned and rebuilt the source code using qmake. Unfortunately, I'm continuing to get similar "undefined reference" errors.
I haven't tried using qtcreator yet. Does it treat the code any differently during the build process?

@chchwy, I tried downloading and building the raw qt tar.gz file from Qt's website to use for my Pencil build. I followed their instructions, but I only got as far as:

gerg@gerg-MS-7693 cd /home/gerg/qt-everywhere-opensource-src-5.7.0
gerg@gerg-MS-7693 ~/qt-everywhere-opensource-src-5.7.0 $ ./configure -static -prefix /home/gerg/qt-everywhere-opensource-src-5.7.0
gerg@gerg-MS-7693 ~/qt-everywhere-opensource-src-5.7.0 $ make

The static Qt build failed with more "undefined reference" errors, and the auto-generated Makefiles link to static libraries that don't exist just like my Pencil2D makefiles. I guess this problem has more to do with my OS or Qt.
I'm going to continue to explore solutions and maybe see what the folks in the Qt forums think about it.

thanks

Hello again,

I have managed to get Pencil2D to successfully build by compiling in a virtual machine running Debian-8.5.0. It all built without any problems once I had all the right packages installed which was pretty surprising after how long I've been working on this. I tried reinstalling all my qt5 packages on my mint OS and the program built right away.

I guess that my qt packages got modified/corrupted somehow and the solution was as simple as reinstalling some packages. This doesn't really explain why the packages I downloaded directly from https://www.qt.io/download/ had the same problem, but I will save that question for another day as I am ready to move on and start contributing to this project.

Thank you everyone for your help

@GregorysonofCarl Good news indeed! Thank you for keeping us posted on your issues. We can definitely use more assistance with the development of Pencil2D.
Maybe let's keep this post open to see if others have similar issues with Debian based systems.

I've successfully built the source code on fedora linux. Installed the following packages:
zlib zlib-devel qt5-qtsvg-devel qt5-qtsvg qt5-qtxmlpatterns qt5-qtxmlpatterns-devel qt5-qtmultimedia qt5-qtmultimedia-devel

Was this page helpful?
0 / 5 - 0 ratings