[vtkusers] vtk 3.2 static library in an ActiveX control - Link errors - need help

Ted Christiansen ted at caept.com
Thu Aug 15 15:51:03 EDT 2002


Hello,

I am developing an ActiveX control for use in a webpage.  I would like
to compile it using the static library version of vtk 3.2 as I dont want
users to have to download the 8 MB DLL when I am only using a small
portion of the functions in the vtklib.dll.

Have the Kitware folks done this with their PolyViz ActiveX control?
Their help would be appreciated.

I am having trouble compiling it whlie linking in a static version of
vtk 3.2.  The libraries I am linking with: vtkstatic.lib opengl32.lib.
With MFC static I get these errors and warnings:

--------------------Configuration: fevisocx - Win32
Release--------------------
Linking...
LIBC.lib(crt0dat.obj) : error LNK2005: __cinit already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __exit already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __cexit already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __C_Exit_Done already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __C_Termination_Done already
defined in libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __exitflag already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __wpgmptr already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __pgmptr already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___winitenv already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __wenviron already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___initenv already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __environ already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___wargv already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___argv already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: ___argc already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __winminor already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __winmajor already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __winver already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __osver already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : error LNK2005: __umaskval already defined in
libcmt.lib(crt0dat.obj)
LIBC.lib(crt0dat.obj) : warning LNK4006: __cinit already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: _exit already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __exit already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __cexit already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __c_exit already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __C_Exit_Done already defined
in libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __C_Termination_Done already
defined in libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __exitflag already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __wpgmptr already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __pgmptr already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: ___winitenv already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __wenviron already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: ___initenv already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __environ already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: ___wargv already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: ___argv already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: ___argc already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __winminor already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __winmajor already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __winver already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __osver already defined in
libcmt.lib(crt0dat.obj); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: __umaskval already defined in
libcmt.lib(crt0dat.obj); second definition ignored
   Creating library Release/fevisocx.lib and object Release/fevisocx.exp

LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other
libs; use /NODEFAULTLIB:library
Release/fevisocx.ocx : fatal error LNK1169: one or more multiply defined
symbols found
Error executing link.exe.

fevisocx.ocx - 23 error(s), 23 warning(s)




With MFC dynamic (DLL) I get these:

--------------------Configuration: fevisocx - Win32
Release--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
FEvisCtl.cpp
fevisocx.cpp
FEvisPpg.cpp
Generating Code...
Linking...
libci.lib(ostream.obj) : error LNK2005: "public: class ostream &
__thiscall ostream::operator<<(char const *)"
(??6ostream@@QAEAAV0 at PBD@Z) already defined in msvcirt.lib(MSVCIRT.dll)
libci.lib(ostream.obj) : error LNK2005: "public: class ostream &
__thiscall ostream::flush(void)" (?flush at ostream@@QAEAAV1 at XZ) already
defined in msvcirt.lib(MSVCIRT.dll)
libci.lib(_ios.obj) : error LNK2005: "public: virtual __thiscall
ios::~ios(void)" (??1ios@@UAE at XZ) already defined in
msvcirt.lib(MSVCIRT.dll)
LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in
msvcrt.lib(MSVCRT.dll)
LIBC.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in
msvcrt.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in
msvcrt.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in
msvcrt.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in
msvcrt.lib(cinitexe.obj)
libci.lib(ostream.obj) : warning LNK4006: "public: class ostream &
__thiscall ostream::operator<<(char const *)"
(??6ostream@@QAEAAV0 at PBD@Z) already defined in msvcirt.lib(MSVCIRT.dll);
second definition ignored
libci.lib(ostream.obj) : warning LNK4006: "public: class ostream &
__thiscall ostream::flush(void)" (?flush at ostream@@QAEAAV1 at XZ) already
defined in msvcirt.lib(MSVCIRT.dll); second definition ignored
libci.lib(_ios.obj) : warning LNK4006: "public: virtual __thiscall
ios::~ios(void)" (??1ios@@UAE at XZ) already defined in
msvcirt.lib(MSVCIRT.dll); second definition ignored
LIBC.lib(crt0dat.obj) : warning LNK4006: _exit already defined in
msvcrt.lib(MSVCRT.dll); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in
msvcrt.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in
msvcrt.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in
msvcrt.lib(cinitexe.obj); second definition ignored
LIBC.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in
msvcrt.lib(cinitexe.obj); second definition ignored
   Creating library Release/fevisocx.lib and object Release/fevisocx.exp

LINK : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of
other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other
libs; use /NODEFAULTLIB:library
LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Release/fevisocx.ocx : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

fevisocx.ocx - 10 error(s), 10 warning(s)



I have tried excluding the offending libraries but this leads to missing
symbols.  Has anyone successfully done this?   Any help would be
appreciated.

Ted




More information about the vtkusers mailing list