[Insight-users] compile time errors on MSVC.NET using MFCs
Luis Ibanez
luis.ibanez at kitware.com
Sun Sep 18 15:26:07 EDT 2005
Hi Rama,
If you are getting error messages at link time,
regarding redundant libraries, you *SHOULD NOT*
ignore any of these libraries.
The real source of the problem is that you are mixing
libraries that were build with different compilation options.
You *MUST* make sure that all the libraries that
you use have been compiled for:
- Multi-Threading
- Debug
or all of them for
- Multi-Threading
- Release
Never force the linker to go pass those error
messages, because you will get an executable that
will crash at any moment.
By now,
you can better understand why we use CMake :-)
Regards,
Luis
----------------------------
Rama Aravind Vorray wrote:
> Hi Luis,
>
> No, I cannot use CMake at this stage as I already had
> a huge MFC based project in Visual Studio and I want
> to use ITK just for doing one task. That is, to rotate
> a 3D Image.
>
> I tried all possibilities that Karthik suggeted
> previously. I Included all the directories that he
> suggested and I linked my applicaiton against all the
> .lib files that karthik suggested.
>
> I took care that I am linking debug libraries of ITK
> with my application's debug build.
>
> $ITKDIR\bin\debug is the place where ITK created all
> libraries in debug build and $ITKDIR\bin\release is
> the place where ITK created all release build
> libraries.
>
> Still I am receiving innumerable link errors. Like
> LNK2005 errors.
>
> I am sending you a zipped file. It includes my
> projects' visual studio project files. They are empty
> but they show all the settings of my project icluding
> Include directories and Libraries I am linking with.
> It also insludes BuildLog with all errors. You can see
> all the errors (LNK2005) in that file.
>
> Please find it attached with this email.
>
> I tried to ignore msvcprtd.lib file in my project but
> when I do that I am getting some thousands of errors.
> I think I can't ignore msvcprtd.lib file in my
> project.
>
> I wish you can suggest a way out of these errors.
>
> thank you,
> Aravind.
>
> --- Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>
>>Hi Rama,
>>
>>
>>Are you using CMake for configuring your project ?
>>
>>
>> Regards,
>>
>> Luis
>>
>>
>>---------------------------
>>Rama Aravind Vorray wrote:
>>
>>>Hi,
>>>
>>>I am trying to use itkAffineTranform class in my
>>>OpenGL-MFC-SDI applicaiton and when I had included
>>
>>the
>>
>>>necessary itkAffineTransform.h file I am getting
>>
>>some
>>
>>>strange errors like below.
>>>
>>>error C2802: static member 'operator new' has no
>>>formal parameters
>>>error C2091: function returns function
>>>error C2090: function returns array
>>>error C2059: syntax error : 'string'
>>>error C2059: syntax error : 'string'
>>>
>>>and I am being pointed out to the itkLightObject.h
>>>file when I try to see from where this error is
>>>generated.
>>>
>>>It is pointing me to this place in the
>>>itkLightObject.h file.
>>>
>>>#ifdef _WIN32
>>> /** Used to avoid dll boundary problems. */
>>> void* operator new(size_t);
>>> void* operator new[](size_t);
>>> void operator delete(void*);
>>> void operator delete[](void*, size_t);
>>>#endif
>>>
>>>What is causing this error and how to rectify it.
>>>
>>>I tried to comment out these lines in the
>>>itkLightObject.h and corresponding functions in
>>>itkLightObject.cxx. But then I am getting some
>>>hundreds of linker errors, like unresolved
>>
>>external
>>
>>>symbol itk::PrintHeader, etc.
>>>
>>>Can you please suggest me what to do to get rid
>>
>>off
>>
>>>above errors.
>>>
>>>regards,
>>>aravind.
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Tired of spam? Yahoo! Mail has the best spam
>>
>>protection around
>>
>>>http://mail.yahoo.com
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>>
>>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
More information about the Insight-users
mailing list