[Radiance-dev] Problems with using VC6

Georg Mischler radiance-dev@radiance-online.org
Wed, 31 Dec 2003 06:59:01 -0500 (EST)


Patrik Müller wrote:

> Hi all,
>
> I'll try to build a Viewer like RShow for Windows. For this I've included
> several files from the "src" path to my C++ project (the files mentioned in
> the "filefmts.pdf"). The compiling seems to works but I still has a linking
> error:
>
> Linker-Vorgang läuft...
>    Bibliothek ../bin/TKIM_Radiance.lib und Objekt ../bin/TKIM_Radiance.exp
> wird erstellt
> sceneio.obj : error LNK2001: Nichtaufgeloestes externes Symbol _ofun
> mesh.obj : error LNK2001: Nichtaufgeloestes externes Symbol _ofun
> modobject.obj : error LNK2001: Nichtaufgeloestes externes Symbol _ofun
> otypes.obj : error LNK2001: Nichtaufgeloestes externes Symbol _ofun
> readoct.obj : error LNK2001: Nichtaufgeloestes externes Symbol _ofun
> ../bin/TKIM_Radiance.impd : fatal error LNK1120: 1 unaufgeloeste externe
> Verweise
> Fehler beim Ausführen von link.exe.
>
> I normally only use C++ and not C, so a hint would be very nice!


This has nothing to do with C++ vs. C or your compiler version.

We have modified all header files earlier this year so that the
code should compile correctly with any conforming C/C++ compiler.
This also means that you should use the HEAD dump instead of the
outdated 3.5 release if you don't do this already.

What you need is the following definition somewhere:

FUN  ofun[NUMOTYPE] = INIT_OTYPE;

This statement is present in the sources for several Radiance
executables, as well as in src/rt/initotypes.c (linked into
src/lib/libradiance.a if you use the makeall script, and into
src/lib/librttrace.a if you use SCons) for use by the renderers.
The relevant declarations are in src/common/otypes.h.

Since SCons is platform-independent (most of Radiance compiles
fine with VC6 that way), I'd recommend to build Radiance with
this, and just use the resulting libraries for your project.
SCons automatically selects alternative code for some of the
platform specific functionality, so that you don't need to worry
about most unix APIs. Note that SCons also creates a different
and more granular set of libraries than the Rmakefiles, which
gives you more flexibility to link to just what you need.

The SCons build instructions and requirements can be found
somewhere in the archives here, but you can just ask if you need
any further explanations.


-schorsch

-- 
Georg Mischler  --  simulations developer  --  schorsch at schorsch com
+schorsch.com+  --  lighting design tools  --  http://www.schorsch.com/