ROB TOM ROE
  • Home
  • Blog
  • Projects
  • Virtex Edge
  • Contact
March 6, 2016 by rtroe

OCC Tutorial 01 -Setting up OpenCascade in Linux

OCC Tutorial 01 -Setting up OpenCascade in Linux
March 6, 2016 by rtroe

Installing

Before getting started in OpenCascade, you need to install the libraries. Windows have binaries provided, but for Linux, you need to compile from source.

I wrestled for a while with the official source from the OpenCascade site, with very little success when it came to having it run C++ code. But the Community edition worked very easily.

First off, Head over too the GitHub page and download the latest release. As of writing this, the most up to date version is 0.17.1.

I can reiterate what they’ve said, but it’s likely best to read the BUILD.Unix.md file in the source root directory to get a full list of install instructions.

Testing the Install

From there you can can go into the $INSTALL_DIR/bin/directory and run DRAWEXE too see the test harness.

You can find *.tcl files to run tests under source (Source Location)/samples/tcl/

Screenshot from 2016-03-07 15-58-39

Setting Up OCC for Codelite

I use codelite to develop C++ apps, simply because it’s cross platform and easier to work with than CodeBlocks. That said, you should be able to run this on any IDE.

Compiler Options

Compiler Flags

First, set up the compiler options. Too embed it into a wxWidget Control, you will also need to add flags for GTK 2.0 (at least).

-g;-O0;-Wall;
$(shell wx-config --cxxflags --unicode=yes --debug=yes);
$(shell pkg-config --libs --cflags gtk+-2.0);
$(shell pkg-config --libs --cflags glib-2.0);

These need to be added to both the C++ and C compiler Options.

Include Libraries for Compiler

From there, the include libraries, assuming you’ve used the default options, are

/usr/local/include/oce
/usr/include/gtk-2.0

 

Linker Options

Depending on your install and what sort of install you’re using

$(shell wx-config --libs --debug);$(shell pkg-config --libs --cflags gtk+-2.0);$(shell pkg-config --libs --cflags glib-2.0);-lTKernel;-lTKMath;-lTKBRep;-lTKTopAlgo;-lTKPrim;-lTKBO;-lTKOffset;-lTKService;-lTKV3d;-lTKOpenGl;-lTKFillet

The first handful of lines are simply for the wxWidgets library, the last few are for the GTK config and then finally the OCE/OCC libraries are linked at the very end.

Libraries Search Path

You need to then add

/usr/local/lib

to the Libraries Search Path.

Libraries

Add the following libraries to the Libraries section in your Build Settings.

X11
libTKService.so
libTKernel.so
libTKMath.so
libTKBRep.so
libTKV3d.so
libTKOpenGl.so
libTKTopAlgo.so

In the next tutorial, I’ll go over how to embed a OpenCascade Window into  wxWidgets Control.



Related

Previous articleVertices Engine SandboxNext article OpenCascade Tutorial Series

Leave a Reply Cancel reply

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

About The Blog

Nulla laoreet vestibulum turpis non finibus. Proin interdum a tortor sit amet mollis. Maecenas sollicitudin accumsan enim, ut aliquet risus.

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tags

3D 8-Bit AdMOb Ads android Animation Apollo Apollo 11 Audio Audio Puzzle C# Editor Electronics featured Game Dev Game Development Game Engine Gaming Github GLSL Graphics HLSL Japan Javascript Linux Mobile MonoGame NASA OpenGL Optimizations Programming Projects Screen Space Reflections Shaders Source Code SSR Terrain Editor tools Transparency Tutorial Vertices Virtex Edge Design WebGL wxWidgets XNA

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design

Tags

3D 8-Bit AdMOb Ads android Animation Apollo Apollo 11 Audio Audio Puzzle C# Editor Electronics featured Game Dev Game Development Game Engine Gaming Github GLSL Graphics HLSL Japan Javascript Linux Mobile MonoGame NASA OpenGL Optimizations Programming Projects Screen Space Reflections Shaders Source Code SSR Terrain Editor tools Transparency Tutorial Vertices Virtex Edge Design WebGL wxWidgets XNA
Rife Wordpress Theme. Proudly Built By Apollo13

ROB TOM ROE

I’m an Entrepreneur, Software Developer and Mechanical Engineering Grad. I started out working in the Energy and Nuclear safety sector as well as Aircraft Design, Repair and Stress analysis. In 2015 I started Virtex Edge Design , a software and game development company.

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design