Skip to content

Instantly share code, notes, and snippets.

@yunyu
Last active March 28, 2017 22:34
Show Gist options
  • Save yunyu/8f7c4d5a685c3daaaa8b to your computer and use it in GitHub Desktop.
Save yunyu/8f7c4d5a685c3daaaa8b to your computer and use it in GitHub Desktop.

Compiling Octovis in VS2010

Octovis is a graphical viewer for Octomaps. As such, it is extremely useful in being able to know what you're doing.

Note: I'm using a MinGW shell for file operations, but you can do these completely in a graphical environment. I just prefer automation.

Getting a copy

git clone https://github.com/OctoMap/octomap.git
cd octomap

Compiling libQGLViewer

Install the dependencies and follow the instructions here. Remove the prefix in output path (should just be /).

Import the solution into Visual Studio, open Configuration Manager (Right Click Solution -> Configuration Manager), and then set target platform as x64 (you may need to create a new one). Build ALL_BUILD.

When it finishes building, rename QGLViewer2.dll and QGLViewer2.lib (or possibly QGLViewerr2.dll and QGLViewerr2.lib) to QGLViewer.dll and QGLViewer.lib.

Compiling Octomap

Import the octomap root into CMake and generate with VS2010 x64, with output as /build. Import the solution into Visual Studio, open Configuration Manager (Right Click Solution -> Configuration Manager), and then set target platform as x64 (you may need to create a new one). Build ALL_BUILD. This will fail.

Then, in /lib,

for f in Release/*.lib; do cp $f lib`echo $f | sed s/.lib// | sed s#Release/##`.dll; done

Build ALL_BUILD again, and you should see octovis.exe in /bin.

@ryanchilton
Copy link

@yunyul Can you please tell me how you were able to get libQGLViewer to compile for a 64-bit target if the linked libraries (glu32.lib, etc. and the qt libraries) are 32 bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment