QCAD

QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help - Check for Updates)

Tasklist

FS#814 - PATCH - Qcad 3.0.14 and 3.1.0.3 : Patch to fix GCC 4.7 compilation error in opennurbs

Attached to Project: QCAD
Opened by - (yannick56) - Sunday, 26 May 2013, 18:01 GMT+2
Last edited by Andrew (andrew) - Sunday, 26 May 2013, 18:56 GMT+2
Task Type Bug Report
Category Main
Status Closed
Assigned To Andrew (andrew)
Operating System Linux (All / Other)
Severity Critical
Priority Normal
Reported Version 3.0.9 (snapshot)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hello,

When I try to compile Qcad 3.0.14 and 3.1.0.3 with Gcc 4.7.2 anf Glibc 2.17 on Mageia Linux 3 , I have the following error :

g++ -c -pipe -O2 -fPIC -Wall -W -D_REENTRANT -DQCAD_DLL -DPTHREADS -DHAVE_PTHREAD_H -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_SCRIPT_LIB -DQT_SCRIPTTOOLS_LIB -DQT_SVG_LIB -DQT_SQL_LIB -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtHelp -I/usr/include/QtDesigner -I/usr/include/QtUiTools -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtOpenGL -I/usr/include/QtXml -I/usr/include/QtXmlPatterns -I/usr/include/QtSql -I/usr/include/QtSvg -I/usr/include/QtScriptTools -I/usr/include/QtScript -I/usr/include/QtWebKit -I/usr/include -I../../../core -I../../../core/math -I../../../grid -I../../../snap -I../../../gui -I../../../entity -I../../../operations -I../../../scripting -I../../../stemmer -I../../../scripting/ecmaapi -I../../../scripting/ecmaapi/generated -I../../../scripting/ecmaapi/adapters -I../../../io/dxf -I../../../spatialindex -I../../../3rdparty -I/usr/include -Irelease -o release/opennurbs_brep_tools.o ../opennurbs_brep_tools.cpp
In file included from ../opennurbs.h:42:0,

               from ../opennurbs_brep_tools.cpp:16:

../opennurbs_base64.h:130:22: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
In file included from ../opennurbs.h:93:0,

               from ../opennurbs_brep_tools.cpp:16:

../opennurbs_light.h:115:34: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
../opennurbs_light.h:116:40: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
../opennurbs_light.h:117:33: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
../opennurbs_light.h:118:35: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
../opennurbs_light.h:119:40: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
../opennurbs_brep_tools.cpp: In function ‘bool CheckForMatchingVertexIndices(int, int, int*)’:
../opennurbs_brep_tools.cpp:399:13: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
../opennurbs_brep_tools.cpp: At global scope:
../opennurbs_brep_tools.cpp:1981:11: warning: unused parameter ‘start_point’ [-Wunused-parameter]
../opennurbs_brep_tools.cpp:1986:11: warning: unused parameter ‘end_point’ [-Wunused-parameter]
../opennurbs_brep_tools.cpp:2031:11: warning: unused parameter ‘end_point’ [-Wunused-parameter]
../opennurbs_brep_tools.cpp: In member function ‘bool ON_Brep::CloseTrimGap(ON_BrepTrim&, ON_BrepTrim&)’:
../opennurbs_brep_tools.cpp:2084:7: warning: variable ‘coord1_lock’ set but not used [-Wunused-but-set-variable]
../opennurbs_brep_tools.cpp: At global scope:
../opennurbs_brep_tools.cpp:2337:6: warning: unused parameter ‘min_degree’ [-Wunused-parameter]
In file included from ../opennurbs_array.h:1548:0,

               from ../opennurbs.h:47,
               from ../opennurbs_brep_tools.cpp:16:

../opennurbs_array_defs.h: In instantiation of ‘bool ON_SimpleArray<T>::HeapSort(int (*)(const T*, const T*)) [with T = int [2]]’:
../opennurbs_brep_tools.cpp:2769:21: required from here
../opennurbs_array_defs.h:463:7: error: ‘ON_hsort’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from ../opennurbs.h:67:0,

               from ../opennurbs_brep_tools.cpp:16:

../opennurbs_math.h:1403:6: note: ‘void ON_hsort(void*, size_t, size_t, int (*)(void*, const void*, const void*), void*)’ declared here, later in the translation unit
make[5]: * [release/opennurbs_brep_tools.o] Error 1
make[5]: Leaving directory `/home/user/projet-qcad/qcad-3.0.14.0/src/3rdparty/opennurbs/opennurbs’ make[4]:
* [release] Error 2

This task depends upon

Closed by  Andrew (andrew)
Sunday, 26 May 2013, 18:56 GMT+2
Reason for closing:  Fixed
Comment by - (yannick56) - Sunday, 26 May 2013, 18:19 GMT+2

Patch file added in this ticket that use a workaround to fix this problem : opennurbs-gcc4.7-workaround-fix.patch

The better and clean solution to fix this error/problem is to add the "this→" parameter in the line that need it in the source code because gcc 4.7 is more strict with source code than previous release.
stackoverflow .com/questions/10639053/name-lookups-in-c-templates
sourceforge .net/apps/trac/cryptopp/ticket/14

More information here :
Porting to GCC 4.7
gcc.gnu .org/gcc-4.7/porting_to.html
and next read the "Name lookup changes" part.

Comment by Andrew (andrew) - Sunday, 26 May 2013, 18:55 GMT+2

Thanks . Please note that compilation with Gcc 4.7.x is already fixed in the master branch.

Loading...