Every time mess with OSG & Visual Studio 2015 always meet lots of problems which were really tricky, so I decide to write these information down, hope it can help people and myself.
Wayne's Site
I love GitHub
Beijing, CN
Overview
Normally you can find many instructions to say “Hello World” in OSG style.
It should look like following steps:
OSG HelloWorld
for more details check another tutorial. LEARN MORE
Normally codes will be like this:
Compile Error
if you build the codes above maybe you will get many errors.
Notice
Make sure you are using the same x64 or x86 platform configuration with the build of OSG library, if you build x86 application by including x64 library, you will get a similar error message like below: fatal error C1083: Cannot open include file: 'osgviewer/viewer': No such file or directory.
and vice versa.
for this error MSDN tells us we should include windows.h header.
add those lines to above source codes.
then we can build successfully.
Runtime Error
Run the program we built just now, maybe we can run it correctly, maybe not, because we may meet following error:
Error “The program cann’t start because zlibd1.dll is missing from your computer. Try reinstalling the program to fix this problem.”
I don’t know why, but the fact is that We can find zlib*.dll files under OSGPATH/bin folder, but we perhaps notice that there is no zlibd1.dll file in that folder, we may get zlib1.dll and zlibd1d.dll instead. zlibd1d.dll is for debug mode, then what we need to do is to copy zlib1.dll to a new name zlibd1.dll, and copy it into windows path:
Information x86: copy zlibd1.dll to C:\Windows\System32\ x64: copy zlibd1.dll C:\Windows\SysWOW64\
and run above program again. this time we should get glider model displayed on screen.
Leave a Comment