About this blog

Welcome to Ha Le's Work and Research Blog. This page contains information and experience that I've collected during my college's years and other work experience. The topics included are Software development (C++ mainly), Robotics Technology and other related fields.

Search This Blog

Saturday, February 13, 2010

OpenCascade and Qt Integration in Windows and Linux

In my COHESIVE project, it comes to the decision of using OpenCascade as the framework for modelling and visualizing, cos it's powerful enough for our application and... free to use, and Qt as the UI development libraries due to their powerful, cross-platform tools and fantastic documentation.

My project requires the software to be cross-platform (Windows and Unix), therefore the installtion and compilation of the two libraries on both platforms is definitely the start.... But, it's not that easy....So I write this post to help those who want to use the two libraries together cross-platform.

This guide is according to my notes which is already a month old, so it might not contain all steps needed, but I'm pretty positive that it covers at least 90% of what needs to be done.... if you find error, please report here, I might be able to figure out.

1. On Windows (tested on Windows 7 and Xp)
Very easy.

  • Download OpenCascade for Windows and install.
  • Download and install MS Visual C++ Express 2008 (Free). 
  • Download Qt-OPENSOURCE for Windows and compile with VS2008 as here
  • NOTE: the Qt Creator SDK will NOT work with OpenCascade library due to it was compiled by Visual C++ while Qt SDK uses MinGW. I've tried and failed to compile OpenCascade source using MinGW, if you can, that'd be awesome if you can share.
  • Make sure you add in the following to includeyour VC++ Project properties Tools-Options-Projects and Solutions - VC++ Directories 
    • For "include file": add $(PATH)\include and $(CASROOT)\inc 
    • For Library File: add $(CASROOT)\win32\libd
    • Above assumed you used standard installation procedure for OpenCascade and Qt.
    • Make sure environment variable $PATH has the following, it might be overkilled but it worked for me, you can eliminate some if you want C:\OpenCASCADE6.3.0\ros\win32\libd;C:\OpenCASCADE6.3.0\ros;\Qt\4.6.1\bin;C:\OpenCASCADE6.3.0\3rdparty\win32\vs;C:\OpenCASCADE6.3.0\3rdparty\win32\tcltk\bin;C:\OpenCASCADE6.3.0\ros\win32\bin
    • $(CASROOT) should already be set to C:\OpenCASCADE6.3.0\ros\

  • Before compiling, make sure your linker knows it needs OpenCascade Library (VS) Projects--Properties--Configuration Properties -- Linker -- Input 
    • Then aat Additional Dependency, make sure you have (if not, just add), this again might be overkilled... but worked
    • TKernel.lib
    • TKGeomBase.lib
    • TKTopAlgo.lib
    • TKOffset.lib
    • TKBool.lib
    • TKPrim.lib
    • TKFillet.lib
    • odbc32.lib
    • odbccp32.lib
    • TKMath.lib
    • TKService.lib
    • TKV3d.lib
    • TKBrep.lib
    • TKIGES.lib
    • PTKernel.lib
    • TKSTL.lib
    • TKVRML.lib
    • TKSTEP.lib
    • TKShapeSchema.lib
    • TKG3d.lib
    • TKG2d.lib
    • TKXSBase.lib
    • TKPShape.lib
    • TKShHealing.lib
    • TKBO.lib
    • qtmaind.lib
    • QtCored4.lib
    • QtGuid4.lib
    • QtOpenGLd4.lib
    • opengl32.lib
    • glu32.lib
    • Qt3Supportd4.lib
    • comdlg32.lib
    • QtTestd4.lib

  • You should be able to compile and run the "Tutorial" code comes with OpenCascade in VS2008 and see how it works.
  • To be continued

No comments:

Post a Comment