Hello Bryan,

Instead of continuing to give you general advice without practical experience, I tried to do what you're trying to do. My environment is similar to yours: VS Express 2005 on Windows XP.

One caveat: I did not actually test that the plugin works, because I have no VRML files consisting of geometry. I only have files with cubes, spheres, etc. and someone (I think it was Jan) said in another post that those will not work with the OSG VRML plugin. So I only verified that I could compile the plugin, not actually use it. Do you (or anyone else) have a suitable VRML file to test with?

So from Jan's response I checked and as a recap I got my openvrml 0.14.3
from
http://sourceforge.net/project/downloading.php?groupname=artoolkit&filename=OpenVRML-0.14.3-win32.zip&use_mirror=easynews

I started from the same archive. Note that the archive already contains precompiled libs, but when using those to compile the VRML plugin in OSG, you get multiple definition link errors as you saw. That's because of different runtime libraries between what was used in the OpenVRML libs and OSG, so we need to compile OpenVRML ourselves. Up to this point, we're on the same page.

The solution file I opened was in the same directory as you:

...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML

The OSG VRML plugin does not need OpenVRML's openvrml-gl library, nor the lookat application. So I just deleted those projects from the solution.

Pressing F7, I got loads of warnings (I love how Robert keeps his code warning-free on all platforms and compilers, not all projects are this clean), and some errors:

Token.hpp line 76:
replace this line
inline operator<(RefToken l,RefToken r); //{return true;}
with this
inline bool operator<(RefToken l,RefToken r); //{return true;}

AST.hpp line 151:
same thing - replace this line
inline operator<(RefAST l,RefAST r); // {return true;}
with this
inline bool operator<(RefAST l,RefAST r); // {return true;}

and finally, in regerror.c, we have an old-style C function definition:
size_t
regerror(errcode, preg, errbuf, errbuf_size)
int errcode;
const regex_t *preg;
char *errbuf;
size_t errbuf_size;
{

replace it with

size_t
regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
{

And then all compiles correctly (though with quite a few warnings).

Once that was done, I created a directory

...\OpenVRML\home-built

(parallel to the original include, src, etc.) and copied the include dir into that. Then I created a lib subdirectory, and copied the freshly compiled libs into it:

...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\antlr\Release\antlr.lib
...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\openvrml\Release\openvrml.lib
...\OpenVRML\src\openvrml-0.14.3\ide-projects\Windows\VisualC7\OpenVRML\regex\Release\regex.lib

Then, the OSG part. I reran CMake with the top-level CMakeLists.txt, specifying the ...\OpenVRML\home-built\include directory and ...\OpenVRML\home-built\lib\openvrml.lib library in the appropriate places.

Then I needed to add some things to the "Plug 3d vrml" project settings:

- In Linker-General-Additional Library Directories, add the path(s) to your 3rd party lib directory. Get it from the same place in another plugin, for example
  "Plug other png", and copy-paste it there.
- In Linker-Input-Additional dependencies, add the following:
  * antlr.lib
  * regex.lib
  * libjpeg.lib
  * libpng.lib
  * zlib.lib
  * Ws2_32.lib

Then, building the plugin worked. Again, it spewed tons of warnings (coming from the OpenVRML headers of course) but it did compile and link correctly.

But as I said, I did not test that it actually did anything useful...

I hope you can get it to compile and link by following these instructions. Sorry for rambling, and please, don't shoot yourself. There's always a solution. ;-)

Good luck,

J-S
--
______________________________________________________
Jean-Sebastien Guay     [EMAIL PROTECTED]
                        http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to