[Insight-users] using vcf2c.lib

Luis Ibanez luis.ibanez@kitware.com
Wed, 03 Apr 2002 11:12:41 -0500


Hi Jeffrey,


The first block of error messages that you are getting
is due to a mix of compilation options in your code.

Some of your code seems to be compiled with the
"Debug Multithread DLL" option, while other parts
seems to be compiled with the option "Single Threaded".
Each one of these compiling option requires to link
with a particular set of libraries. VC++ is now trying
to satisfy both demands but they are conflicting.


You can verify this from Visual Studio on the menu
option :

  Project -> Settings -> C/C++ -> CodeGeneration

ITK use by default : "Debug Multithreaded DLL", so
probably some of the code that you are adding should
be using the other option.

In practice, the best way to make sure that all your
code is consistant is to avoid to create the project
by hand and use CMake instead.  CMake will generate
.dsw, .dsp file on windows and makefiles on Unix that
are consistent with the whole configuration you have.

The secon block of errors is due to a missing library
in your link options.

If you want to create a new project it may be a good
idea to start from the example in :

          Insight/Examples/SampleProject

a CMakeLists.txt file is provided there. You may want
to start from this one and modify it to fit your
settings.

Please let us know if you encounter any problems
setting up your CMakeLists.txt file.



   Thanks

    Luis


===============================

Jeffrey Duda wrote:
> Hi,
> 
>  
> 
> I've been trying to write some itk classes that make use of fortran code 
> converted via f2c.  This requires linking to the f2c library.  Under 
> unix this does not seem to be a problem, however under windows i run 
> into the linking errors shown below.  If anyone has any experience or 
> ideas regarding this I would greatly appreciate the help.  Thanks.
> 
>  
> 
> Jeffrey Duda
> 
>  
> 
>  
> 
> [vcf2c.lib included]
> 
> --------------------Configuration: FEMOutside - Win32 
> Debug--------------------
> Compiling...
> itkFEMLinearSystemWrapperItpack.cxx
> Linking...
> LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in 
> MSVCRTD.lib(MSVCRTD.dll)
> LIBC.lib(crt0dat.obj) : error LNK2005: __exit already defined in 
> MSVCRTD.lib(MSVCRTD.dll)
> LIBC.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in 
> MSVCRTD.lib(cinitexe.obj)
> LIBC.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in 
> MSVCRTD.lib(cinitexe.obj)
> LIBC.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in 
> MSVCRTD.lib(cinitexe.obj)
> LIBC.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in 
> MSVCRTD.lib(cinitexe.obj)
> LIBC.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in 
> MSVCRTD.lib(crtexe.obj)
> LIBC.lib(strcat.obj) : error LNK2005: _strcpy already defined in 
> MSVCRTD.lib(MSVCRTD.dll)
> LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other 
> libs; use /NODEFAULTLIB:library
> LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other 
> libs; use /NODEFAULTLIB:library
> U:/jtduda/src/itk/Insight-VC/bin/Debug/FEMOutside.exe : fatal error 
> LNK1169: one or more multiply defined symbols found
> Error executing link.exe.
> 
> [vcf2c.lib excluded]
> 
> --------------------Configuration: FEMOutside - Win32 
> Debug--------------------
> Linking...
> dsrc2c.obj : error LNK2001: unresolved external symbol _do_fio
> dsrc2c.obj : error LNK2001: unresolved external symbol _e_wsfe
> dsrc2c.obj : error LNK2001: unresolved external symbol _s_wsfe
> dsrc2c.obj : error LNK2001: unresolved external symbol _pow_dd
> dsrc2c.obj : error LNK2001: unresolved external symbol _i_sign
> dsrc2c.obj : error LNK2001: unresolved external symbol _etime_
> U:/jtduda/src/itk/Insight-VC/bin/Debug/FEMOutside.exe : fatal error 
> LNK1120: 6 unresolved externals
> Error executing link.exe.
> 
>  
> 
> ALL_BUILD - 7 error(s), 0 warning(s)
>