lbellonda / qxmledit

QXmlEdit XML editor. Downloads: https://sourceforge.net/projects/qxmledit/files
http://qxmledit.org
Other
160 stars 46 forks source link

build fail - warnings treated as errors - variable defined and not used #48

Closed delanym closed 6 years ago

delanym commented 6 years ago

I follow build instructions in INSTALL file. During make I get this error:

`cd src/ && make -f Makefile.QXmlEditWidget make[1]: Entering directory '/home/delany/Git/qxmledit/src' g++ -c -include ../build/lib/obj/QXmlEditWidget-0.9.9 -m64 -pipe -Wall -Werror -Wno-unused-local-typedefs -O2 -Wall -W -D_REENTRANT -fPIC -DLIBQXMLEDIT_LIBRARY -DUNIX_RESOURCES -DUNIX_RESOURCE_PATH=/opt/qxmledit -DUNIX_DOC_PATH=/opt/qxmledit -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtXmlPatterns -I/usr/include/qt4/QtSvg -I/usr/include/qt4 -I. -Iglobals/includes -I./globals/framework -Iglobals/includes -Iframework/include -I../build/lib/moc -I../build/lib/ui -o ../build/lib/obj/qrc_risorse.o ../build/lib/rcc/qrc_risorse.cpp In file included from /usr/include/qt4/QtCore/qatomic.h:45:0, from /usr/include/qt4/QtCore/qvariant.h:45, from /usr/include/qt4/QtCore/QVariant:1, from globals/includes/qtincludes.h:30, from globals/includes/xmlEdit.h:77, from precompiled_lib.h:27: ../build/lib/rcc/qrc_risorse.cpp:31361:44: error: ‘qInitResources_risorseinit_variable__’ defined but not used [-Werror=unused-variable] Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_risorse)) ^ /usr/include/qt4/QtCore/qglobal.h:941:21: note: in definition of macro ‘Q_CONSTRUCTOR_FUNCTION0’ static const int AFUNC ## init_variable__ = AFUNC(); ^ ../build/lib/rcc/qrc_risorse.cpp:31361:1: note: in expansion of macro ‘Q_CONSTRUCTOR_FUNCTION’ Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_risorse)) ^ ../build/lib/rcc/qrc_risorse.cpp:31361:24: note: in expansion of macro ‘QT_MANGLE_NAMESPACE’ Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_risorse)) ^ cc1plus: all warnings being treated as errors Makefile.QXmlEditWidget:10870: recipe for target '../build/lib/obj/qrc_risorse.o' failed make[1]: [../build/lib/obj/qrc_risorse.o] Error 1 make[1]: Leaving directory '/home/delany/Git/qxmledit/src' Makefile:41: recipe for target 'sub-src-QXmlEditWidget-pro-make_default-ordered' failed make: [sub-src-QXmlEditWidget-pro-make_default-ordered] Error 2

`

lbellonda commented 6 years ago

Hello, what system and Qt version are you using? What command line and/or environment variables/options are you using to compile?

Thanks

delanym commented 6 years ago

Ubuntu 16.04.3 LTS zsh 5.1.1 (x86_64-ubuntu-linux-gnu)

QMake version 2.01a Using Qt version 4.8.7 in /usr/lib/x86_64-linux-gnu

GNU Make 4.1 Built for x86_64-pc-linux-gnu

lbellonda commented 6 years ago

Hello, you should allow unused variables as warnings to the compiler, the message originates from a Qt macro. Try using options like QMAKE_CXXFLAGS+=-Wno-error=unused-variable in your .pro files if you use Qt4.

delanym commented 6 years ago

qmake QMAKE_CXXFLAGS+=-Wno-error=unused-variable still gives error on make.

I also tried the -Wnone switch to turn off warning.

lbellonda commented 6 years ago

Hello, comment out the following option in all *.pro files

QMAKE_CXXFLAGS +=-Werror

the warnings will not be treated as errors no more.

delanym commented 6 years ago

It builds and installs, but it won't execute.

/opt/qxmledit/qxmledit: error while loading shared libraries: libQXmlEditWidget-0.9.9.so.0: cannot open shared object file: No such file or directory

lbellonda commented 6 years ago

Most likely you need to add the installation folder of the shared libraries to the system path as explained in the wiki:

https://github.com/lbellonda/qxmledit/wiki/Running-on-Linux

lbellonda commented 6 years ago

Hello, any news about the suggestion?

lbellonda commented 6 years ago

Hello, may I close this ticket?

delanym commented 6 years ago

Yes. Thanks for your patience.