[Insight-users] Problems with std::basic_stringbuf and vnl

Sergio Andres sergio at unizar.es
Mon, 19 Apr 2004 20:44:12 +0200


Hi Luis,

Thanks for your answers...

Yes, I am using CMake for creating my MSVC++ projects ...

But I realized that when I compile itk::XMLReader and 
vnl/vnl_matlab_filewrite..
I get some link errors..

msvcprt.lib(MSVCP60.dll) : error LNK2005: "public: virtual __thiscall 
std::basic_stringbuf<char,struct std::char_traits<char>,class 
std::allocator<char> >::~basic_stringbuf<char,struct 
std::char_traits<char>,class std::allocator<char> >(void)" (??1?
$basic_stringbuf at DU?$char_traits at D at std at  at V?$allocator at D at 2 at  at std at  at UAE at XZ) 
already defined in itkvnl.lib(vnl_matlab_filewrite.obj)
msvcprt.lib(MSVCP60.dll) : error LNK2005: "protected: void __thiscall 
std::basic_stringbuf<char,struct std::char_traits<char>,class 
std::allocator<char> >::_Tidy(void)" 
(?_Tidy at ?$basic_stringbuf at DU?$char_traits at D at std at  at V?$allocator at D at 2 at  at std at  at IAEXXZ) 

already defined in itkvnl.lib(vnl_matlab_filewrite.obj)
Release/Main.exe : fatal error LNK1169: one or more multiply defined 
symbols found
Error executing link.exe.


These errors are similar to those I sent previously...
But, I have no idea about them...

My code is the following: (compiled for Release)
----------------------------------------------------
#include <itkXMLFile.h>
#include <vnl/vnl_matlab_filewrite.h>

int main()
{

    typedef itk::XMLReader<double> ReaderType;
    ReaderType::Pointer reader = ReaderType::New();

    vnl_matlab_filewrite mat("file.mat");

    return 0;
}
----------------------------------------------------

I will appreciate any help. :)

Regards,
Sergio.