Slight diversion to QtOpenCASCADE turns into Part 6) Getting MakeBottle.cxx to compile… Success

What I thought was going to be a slight diversion from my little MakeBottle.cxx project turned to sucess.  The Makebottle code is part of of this little cad viewer..  This is a long time coming.  Now I feel I really start learning since I got something that works that I can play with….

I’ve was following the thread from my MakeBottle errors which lead me to:
http://www.opencascade.org/org/forum/thread_11990/

which led me to:
http://www.opencascade.org/org/forum/thread_10815/
which led me to:
http://myweb.tiscali.co.uk/dolbey/QtOpenCascade/index.htm

This apparently is a little cad viewer that can view STEP IGES and BREP files.  It looks like its been discussed quite a bit as how to get it running on Linux so I think if I can follow along, I should should be able to figure out how to get that darn MakeBottle.cxx running. 🙂

Here’s a couple of more links:
http://sourceforge.net/forum/forum.php?thread_id=1848790&forum_id=741332

Hot darn look at that there’s my MakeBottle that I’ve been trying to run located here:
http://qtocc.wiki.sourceforge.net/QTOCC_on_Ubuntu (This looks promising)

Download QT4 from Synaptic… (Picked a bunch of stuff that I hope is appropriate ones…
QtOpencascade need Qt4 working and Opencascade working before running the program..
I think we’re good following the instructions:
jonas@Ubuntu4:~$ cd QtOCC-0.11
jonas@Ubuntu4:~/QtOCC-0.11$ qmake
Project MESSAGE: Building Debug Version
Project MESSAGE: Building for Linux
Project MESSAGE: Building Debug Version
Project MESSAGE: Building Debug Version
Project MESSAGE: Building for Linux
Project MESSAGE: Building Debug Version
Project MESSAGE: Building Release Version
Project MESSAGE: Building for Linux
Project MESSAGE: Building Release Version
jonas@Ubuntu4:~/QtOCC-0.11$
make -f Makefile.Debug all
make[1]: Entering directory /home/jonas/QtOCC-0.11'
g++ -c -pipe -fpermissive -g -D_REENTRANT -Wall -W -DQT_SHARED -DCSFDB -DQOCC_STATIC -D_DEBUG -DLIN -DLININTEL -DHAVE_CONFIG_H -DHAVE_IOSTREAM -DHAVE_FSTREAM -DHAVE_LIMITS_H -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Iinc -I/inc -I/usr/X11R6/include -Idebug -I. -o debug/main.o src/main.cpp
In file included from inc/qoccapplication.h:24,
from src/main.cpp:27:
inc/qocc.h:47:37: error: AIS_StatusOfDetection.hxx: No such file or directory
inc/qocc.h:48:32: error: AIS_StatusOfPick.hxx: No such file or directory
inc/qocc.h:49:31: error: Aspect_Drawable.hxx: No such file or directory
inc/qocc.h:50:35: error: Aspect_GridDrawMode.hxx: No such file or directory
inc/qocc.h:51:31: error: Aspect_GridType.hxx: No such file or directory
inc/qocc.h:52:42: error: Aspect_GraphicCallbackProc.hxx: No such file or directory
inc/qocc.h:53:45: error: Handle_AIS_InteractiveContext.hxx: No such file or directory
inc/qocc.h:54:31: error: Handle_V3d_View.hxx: No such file or directory
inc/qocc.h:55:33: error: Handle_V3d_Viewer.hxx: No such file or directory
inc/qocc.h:56:48: error: Handle_TopTools_HSequenceOfShape.hxx: No such file or directory
inc/qocc.h:57:32: error: Standard_TypeDef.hxx: No such file or directory
inc/qocc.h:58:31: error: Quantity_Factor.hxx: No such file or directory
inc/qocc.h:59:31: error: Quantity_Length.hxx: No such file or directory
inc/qocc.h:60:36: error: Quantity_NameOfColor.hxx: No such file or directory
inc/qocc.h:61:30: error: V3d_Coordinate.hxx: No such file or directory
inc/qocc.h:66:32: error: Handle_Xw_Window.hxx: No such file or directory
In file included from inc/qoccharnesswindow.h:22,
from src/main.cpp:28:
inc/qoccviewercontext.h:32: warning: ISO C++ forbids declaration of ‘Handle_V3d_Viewer’ with no type
inc/qoccviewercontext.h:32: error: expected ‘;’ before ‘&’ token
inc/qoccviewercontext.h:33: warning: ISO C++ forbids declaration of ‘Handle_AIS_InteractiveContext’ with no type
inc/qoccviewercontext.h:33: error: expected ‘;’ before ‘&’ token
inc/qoccviewercontext.h:35: error: ‘Handle_V3d_Viewer’ does not name a type
inc/qoccviewercontext.h:42: error: ‘Quantity_Length’ has not been declared
inc/qoccviewercontext.h:60: error: ‘Handle_V3d_Viewer’ does not name a type
inc/qoccviewercontext.h:61: error: ‘Handle_AIS_InteractiveContext’ does not name a type
inc/qoccviewercontext.h:62: error: ‘Aspect_GridType’ does not name a type
inc/qoccviewercontext.h:63: error: ‘Aspect_GridDrawMode’ does not name a type
inc/qoccviewercontext.h:64: error: ‘Quantity_NameOfColor’ does not name a type
inc/qoccviewercontext.h:65: error: ‘Quantity_NameOfColor’ does not name a type
In file included from inc/qoccharnesswindow.h:23,
from src/main.cpp:28:
inc/qoccviewwidget.h:93: error: ‘V3d_Coordinate’ has not been declared
inc/qoccviewwidget.h:93: error: ‘V3d_Coordinate’ has not been declared
inc/qoccviewwidget.h:93: error: ‘V3d_Coordinate’ has not been declared
inc/qoccviewwidget.h:94: error: ‘V3d_Coordinate’ has not been declared
inc/qoccviewwidget.h:94: error: ‘V3d_Coordinate’ has not been declared
inc/qoccviewwidget.h:94: error: ‘V3d_Coordinate’ has not been declared
inc/qoccviewwidget.h:141: error: ‘Handle_Xw_Window’ does not name a type
inc/qoccviewwidget.h:144: error: field ‘myView’ has incomplete type
inc/qoccviewwidget.h:145: error: ‘Handle_V3d_Viewer’ does not name a type
inc/qoccviewwidget.h:146: error: field ‘myContext’ has incomplete type
inc/qoccviewwidget.h:148: error: ‘Standard_Boolean’ does not name a type
inc/qoccviewwidget.h:149: error: ‘Standard_Boolean’ does not name a type
inc/qoccviewwidget.h:151: error: ‘Quantity_Factor’ does not name a type
inc/qoccviewwidget.h:152: error: ‘Standard_Boolean’ does not name a type
inc/qoccviewwidget.h:153: error: ‘AIS_StatusOfDetection’ does not name a type
inc/qoccviewwidget.h:155: error: ‘V3d_Coordinate’ does not name a type
inc/qoccviewwidget.h:163: error: ‘Standard_Real’ does not name a type
inc/qoccviewwidget.h:164: error: ‘Standard_Real’ does not name a type
inc/qoccviewwidget.h:165: error: ‘Standard_Boolean’ does not name a type
inc/qoccviewwidget.h:182: error: ‘AIS_StatusOfPick’ does not name a type
inc/qoccviewwidget.h:183: error: ‘AIS_StatusOfPick’ does not name a type
inc/qoccviewwidget.h:184: error: ‘AIS_StatusOfDetection’ does not name a type
inc/qoccviewwidget.h:188: error: ‘Standard_Real’ does not name a type
inc/qoccviewwidget.h:189: error: ‘Standard_Real’ does not name a type
inc/qoccviewwidget.h:195: error: ‘Standard_Boolean’ does not name a type
inc/qoccviewwidget.h:202: error: ‘Aspect_Drawable’ has not been declared
inc/qoccviewwidget.h:204: error: ‘Aspect_GraphicCallbackStruct’ has not been declared
inc/qoccviewwidget.h:208: error: ‘Standard_CString’ has not been declared
inc/qoccviewwidget.h:72: error: default argument for parameter of type ‘const Handle_AIS_InteractiveContext&’ has type ‘int’
inc/qoccviewwidget.h:78: error: default argument for parameter of type ‘const Handle_AIS_InteractiveContext&’ has type ‘int’
inc/qoccviewwidget.h: In member function ‘Handle_AIS_InteractiveContext QoccViewWidget::getContext()’:
inc/qoccviewwidget.h:80: error: return type ‘struct Handle_AIS_InteractiveContext’ is incomplete
inc/qoccviewwidget.h:80: error: ‘myContext’ was not declared in this scope
inc/qoccviewwidget.h: In member function ‘Handle_V3d_View QoccViewWidget::getView()’:
inc/qoccviewwidget.h:81: error: return type ‘struct Handle_V3d_View’ is incomplete
inc/qoccviewwidget.h:81: error: ‘myView’ was not declared in this scope
In file included from inc/qoccharnesswindow.h:24,
from src/main.cpp:28:
inc/qoccinputoutput.h: At global scope:
inc/qoccinputoutput.h:54: error: ‘Handle_TopTools_HSequenceOfShape’ does not name a type
inc/qoccinputoutput.h:58: error: expected ‘,’ or ‘...’ before ‘&’ token
inc/qoccinputoutput.h:58: warning: ISO C++ forbids declaration of ‘Handle_TopTools_HSequenceOfShape’ with no type
inc/qoccinputoutput.h:60: error: ‘Handle_TopTools_HSequenceOfShape’ does not name a type
inc/qoccinputoutput.h:62: error: ‘Handle_TopTools_HSequenceOfShape’ does not name a type
inc/qoccinputoutput.h:64: error: ‘Handle_TopTools_HSequenceOfShape’ does not name a type
inc/qoccinputoutput.h:65: error: ‘Handle_TopTools_HSequenceOfShape’ does not name a type
inc/qoccinputoutput.h:66: error: ‘Handle_TopTools_HSequenceOfShape’ does not name a type
inc/qoccinputoutput.h:68: error: expected ‘,’ or ‘...’ before ‘&’ token
inc/qoccinputoutput.h:68: warning: ISO C++ forbids declaration of ‘Handle_TopTools_HSequenceOfShape’ with no type
inc/qoccinputoutput.h:69: error: expected ‘,’ or ‘...’ before ‘&’ token
inc/qoccinputoutput.h:69: warning: ISO C++ forbids declaration of ‘Handle_TopTools_HSequenceOfShape’ with no type
inc/qoccinputoutput.h:70: error: expected ‘,’ or ‘...’ before ‘&’ token
inc/qoccinputoutput.h:70: warning: ISO C++ forbids declaration of ‘Handle_TopTools_HSequenceOfShape’ with no type
inc/qoccinputoutput.h:71: error: expected ‘,’ or ‘...’ before ‘&’ token
inc/qoccinputoutput.h:71: warning: ISO C++ forbids declaration of ‘Handle_TopTools_HSequenceOfShape’ with no type
inc/qoccinputoutput.h:72: error: expected ‘,’ or ‘...’ before ‘&’ token
inc/qoccinputoutput.h:72: warning: ISO C++ forbids declaration of ‘Handle_TopTools_HSequenceOfShape’ with no type
inc/qoccinputoutput.h:73: error: expected ‘,’ or ‘...’ before ‘&’ token
inc/qoccinputoutput.h:73: warning: ISO C++ forbids declaration of ‘Handle_TopTools_HSequenceOfShape’ with no type
inc/qoccinputoutput.h:75: error: expected ‘,’ or ‘...’ before ‘&’ token
inc/qoccinputoutput.h:75: warning: ISO C++ forbids declaration of ‘Handle_TopTools_HSequenceOfShape’ with no type
In file included from src/main.cpp:28:
inc/qoccharnesswindow.h:52: error: ‘V3d_Coordinate’ has not been declared
inc/qoccharnesswindow.h:53: error: ‘V3d_Coordinate’ has not been declared
inc/qoccharnesswindow.h:54: error: ‘V3d_Coordinate’ has not been declared
inc/qoccharnesswindow.h:55: error: ‘V3d_Coordinate’ has not been declared
inc/qoccharnesswindow.h:56: error: ‘V3d_Coordinate’ has not been declared
inc/qoccharnesswindow.h:57: error: ‘V3d_Coordinate’ has not been declared
inc/qoccharnesswindow.h: In member function ‘Handle_AIS_InteractiveContext& QoccHarnessWindow::getContext()’:
inc/qoccharnesswindow.h:37: error: ‘class QoccViewerContext’ has no member named ‘getContext’
make[1]: *** [debug/main.o] Error 1
make[1]: Leaving directory
/home/jonas/QtOCC-0.11′
make: *** [debug-all] Error 2
jonas@Ubuntu4:~/QtOCC-0.11$

I thought this was too good to be true….
I might as well pick off the first error
inc/qocc.h:47:37: error: AIS_StatusOfDetection.hxx: No such file or directory

jonas@Ubuntu4:~/QtOCC-0.11$ sudo updatedb
[sudo] password for jonas:
jonas@Ubuntu4:~/QtOCC-0.11$ locate  AIS_StatusOfDetection.hxx
/usr/include/opencascade/AIS_StatusOfDetection.hxx
jonas@Ubuntu4:~/QtOCC-0.11$
This not bad I guess I just need to figure out how to get -I/usr/include/opencascade into the compiler string….  (This would be a heck of a lot easier if I knew what I was doing….)

Ok… I think I found something.  This is in the qtopencascade documentation:

“The project uses the CASROOT and QTDIR environment variables to locate include files and libraries on your system – these are assumed to be in default relative locations e.g. include files in $(CASROOT)\lib. To build the apps in debug and release just cd into the folder from a cmd prompt, set up your compiler and Qt environment variables then type: -”

Since I used the debian download of OCC it doesn’t suprise me that CASROOT enviroment variable is not defined… I’m not sure about QTDIR

I just ran a handy link. This is cool for what I’m doing:
http://csg.sph.umich.edu/docs/hints/learnUNIXin10minutes.html

Ok… Something is telling me I’m hosed at the moment. But I going to try:
setenv CASROOT /usr/include/opencascade
This won’t work…..
I think qmake generates a make file from a file called QtOpenCascadeLinux.pri
Here’s the content’s.

CONFIG(release, release|debug) {
message (“Building Release Version”)
LIBS += -L$(CASROOT)/Linux/lib -lBinLPlugin \
-lBinPlugin \
-lBinXCAFPlugin \
-lFWOSPlugin \
-lmscmd \
-lPTKernel \
-lStdLPlugin \
-lStdPlugin \
-lTKAdvTools \
-lTKBin \
-lTKBinL \
-lTKBinXCAF \
-lTKBO \
-lTKBool \
-lTKBRep \
-lTKCAF \
-lTKCDF \
-lTKCDLFront \
-lTKCPPClient \
-lTKCPPExt \
-lTKCPPIntExt \
-lTKCPPJini \
-lTKCSFDBSchema \
-lTKDCAF \
-lTKDraw \
-lTKernel \
-lTKFeat \
-lTKFillet \
-lTKG2d \
-lTKG3d \
-lTKGeomAlgo \
-lTKGeomBase \
-lTKHLR \
-lTKIDLFront \
-lTKIGES \
-lTKLCAF \
-lTKMath \
-lTKMesh \
-lTKMeshVS \
-lTKOffset \
-lTKOpenGl \
-lTKPCAF \
-lTKPLCAF \
-lTKPrim \
-lTKPShape \
-lTKService \
-lTKShapeSchema \
-lTKShHealing \
-lTKStdLSchema \
-lTKStdSchema \
-lTKSTEP \
-lTKSTEP209 \
-lTKSTEPAttr \
-lTKSTEPBase \
-lTKSTL \
-lTKTCPPExt \
-lTKTopAlgo \
-lTKTopTest \
-lTKV2d \
-lTKV3d \
-lTKViewerTest \
-lTKVRML \
-lTKXCAF \
-lTKXCAFSchema \
-lTKXDEDRAW \
-lTKXDEIGES \
-lTKXDESTEP \
-lTKXml \
-lTKXmlL \
-lTKXmlXCAF \
-lTKXSBase \
-lTKXSDRAW \
-lXCAFPlugin \
-lXmlLPlugin \
-lXmlPlugin \
-lXmlXCAFPlugin
#        -ltk -lXmu
}
#################################################################
# Change the lib to libd if you have a debug OpenCASCADE build.    #
#################################################################
CONFIG(debug, release|debug) {
message (“Building Debug Version”)
LIBS += -L$(CASROOT)/Linux/lib -lBinLPlugin \
-lBinPlugin \
-lBinXCAFPlugin \
-lFWOSPlugin \
-lmscmd \
-lPTKernel \
-lStdLPlugin \
-lStdPlugin \
-lTKAdvTools \
-lTKBin \
-lTKBinL \
-lTKBinXCAF \
-lTKBO \
-lTKBool \
-lTKBRep \
-lTKCAF \
-lTKCDF \
-lTKCDLFront \
-lTKCPPClient \
-lTKCPPExt \
-lTKCPPIntExt \
-lTKCPPJini \
-lTKCSFDBSchema \
-lTKDCAF \
-lTKDraw \
-lTKernel \
-lTKFeat \
-lTKFillet \
-lTKG2d \
-lTKG3d \
-lTKGeomAlgo \
-lTKGeomBase \
-lTKHLR \
-lTKIDLFront \
-lTKIGES \
-lTKLCAF \
-lTKMath \
-lTKMesh \
-lTKMeshVS \
-lTKOffset \
-lTKOpenGl \
-lTKPCAF \
-lTKPLCAF \
-lTKPrim \
-lTKPShape \
-lTKService \
-lTKShapeSchema \
-lTKShHealing \
-lTKStdLSchema \
-lTKStdSchema \
-lTKSTEP \
-lTKSTEP209 \
-lTKSTEPAttr \
-lTKSTEPBase \
-lTKSTL \
-lTKTCPPExt \
-lTKTopAlgo \
-lTKTopTest \
-lTKV2d \
-lTKV3d \
-lTKViewerTest \
-lTKVRML \
-lTKXCAF \
-lTKXCAFSchema \
-lTKXDEDRAW \
-lTKXDEIGES \
-lTKXDESTEP \
-lTKXml \
-lTKXmlL \
-lTKXmlXCAF \
-lTKXSBase \
-lTKXSDRAW \
-lXCAFPlugin \
-lXmlLPlugin \
-lXmlPlugin \
-lXmlXCAFPlugin
#        -ltk -lXmu
}

I think the problem is with ” LIBS += -L$(CASROOT)/Linux/lib -lBinLPlugin \”
to LIBS += -L/usr/lib/ -lBinLPlugin \

This seems reasonable….
See what happens.  Nothing…..
I don’t understand how CASROOT comes into play. with qmake which generates the makefiles…
I guest its time to read a manual on qmake:http://doc.trolltech.com/4.3/qmake-manual.html

Ok… I think I need to add a “INCLUDEPATH += /usr/include/opencascade” and try this again and see what happens.
That seems to have done the trick…. 😉 At any rate I got a huge amount of output from the compiler…
Oh yeah….. Not only do I have a cad view but my MakeBottle also…. Success…

MakeBottle using qtopencascade

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Slight diversion to QtOpenCASCADE turns into Part 6) Getting MakeBottle.cxx to compile… Success

  1. Peter Dolbey says:

    S’funny – seemed ever so much easier when I did it….
    Pete

  2. admin says:

    Life has taken me in a different direction of late…..

Leave a Reply

Your email address will not be published. Required fields are marked *