Open Inventor FAQs - Troubleshooting -- Compile/link/execute problems


[Win32] When I try to build the Open Inventor sample examples, I get a link error.

(NOTE: In general, when reporting a problem to the hotline, you should be very specific about describing the error. The term "link error" used here is not very specific. There are lots of possible link errors.)

The makefiles that we supply are designed to work "out of the box." If you (not someone with a different login) installed Open Inventor, the VC++ IDE should be set up correctly such that the Inventor sample programs will build successfully -- without you having to do anything other than click the Build button.

Since Open Inventor 8.0, we use the CMAKE utility program to generate project files on all platforms. See the building demos chapter for more information on how to proceed.

Read that whole section and make sure that you have set up the IDE appropriately, then try to build an Open Inventor Mentor program. When that works, then try to build an IVF program. After that, then try your program.


[Win32] Every time I link with the Visual C++ Linker I get an error saying "Unresolved external symbol: _main"

That isn't quite enough information to say for sure what the problem is... For example it depends on what kind of executable you're targeting. If you're building a "console app" (the closest thing to a "normal" UNIX cmd-line program) then it means what it says -- you need a function "main"!

However if you're building one of the Inventor Mentor examples we provide and *not* using our make file, the situation is a little more complicated. Those programs were ported long ago, before console apps existed (NT 3.0!), so they have a function "main" but *also* have a "#define main ivMain" and require that you link in a utility library named "INVU.LIB" which has a function "WinMain" (like a "classic" Windows app) which turns around and calls your "ivMain". This solution looks cumbersome now, but we've been too busy adding new features to go back and clean it up. :-) If this is your situation, first try making sure INVU.LIB is in your link string -- note that this is the only Inventor lib that (normally) has to be specified explicitly. Or... try creating a new project that is a console app, add this source file to it but remove the "#define main ivMain".


[Win32] Why do I see so many memory leaks reported when my Open Inventor application terminates?

Starting with Open Inventor 5.0, SoDB, SoWin, SoXt, SoQt, SoNodeKit, and SoInteraction now have a finish method that you can call at the end of your application to free (most of) Open Inventor's internal static memory allocations.

If you are using a memory leak detector, calling finish will eliminate a large number of false positives that have historically been an annoyance to programmers trying to track down "real" memory leaks.

Although there is no requirement to call finish, for "cleanliness" we recommend that all applications do call it.

Please note that to write a really "clean" application, you must still free memory that your app has allocated or caused to be allocated. For example, even for a very trivial program, you would need to delete the viewer object and unref the root of the scene graph.


[Win32] How do I check my path? Why should I check my path?

The directories in your path are searched at run-time for DLLs that are needed to run your (Open Inventor) application. It's a good idea to check your path if any DLLs are reported as missing, or if your program is behaving strangely (e.g. crashing, exiting without doing anything, etc.).

Any version of Windows

Check the path by opening a DOS prompt window (aka "command shell window") and typing "path" (or "set").

WinNT

If you prefer the point-and-click approach, you can do the following:

From the Start menu,

  • Settings...
  • Control Panel (applet)
  • System (icon)
  • Environment (tab)

Check the "path" variable. There may be two occurrences of it, one in the System variables area, one in the User variables area. Make sure it doesn't contain references to older versions of Open Inventor. If you change the path, the change affects only the windows opened since the change was made. If you have existing DOS prompt windows, they will not be affected.

Win2K, WinXP

If you prefer the point-and-click approach, you can do the following:

  • Settings...
  • Control Panel (applet)
  • System (icon)
  • Advanced (tab)
  • Environment Variables (button)

From the Start menu

Check the "path" variable. There may be two occurrences of it, one in the System variables area, one in the User variables area. Make sure it doesn't contain references to older versions of Open Inventor. If you change the path, the change affects only the windows opened since the change was made. If you have existing DOS prompt windows, they will not be affected.


[Win32] How can I tell which DLLs are being used by my application?

There is a nifty utility program called "depends" that will tell you which DLLs are being used by your application. This info can be helpful for troubleshooting, for example, if your program runs successfully on one system but not on another.

You run the program from the command line, as follows:

depends /p your_app_name.exe

Use the following command to get a list of the command line options:

depends /? 

This utility program (written by a third party) is available in the following directory:

$OIVHOME/src/Inventor/contrib/FAQ /depends.zip

Note that recent versions of Visual Studio include a utility program named "depends". This is not the same program. Although it provides the same service, the new program is a GUI-based program and much slower.


I'm having a problem with custom nodes using multiple inheritance.

If a custom node class uses multiple inheritance, the Open Inventor parent class must be the first one in the list. Otherwise, the SoNode::copy() method will fail.