browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need .NET Framework help?

Get answers from our community of .NET Framework experts on BYTES! It's free.

Linking problem when porting C++ to .Net

Joannes Vermorel
Guest
 
Posts: n/a
#1: Nov 17 '05
I am currently trying to port a small open source scientfic library written
in C++ to .Net. The code (including the VS solution) could be found at
http://www.vermorel.com/opensource/selfscaling.zip

My problem is that when I try to compile the library I got a list of linking
error messages. I am not a specialist of porting C++ code to .Net. Does
anyone has an idea on how to make this code compile in .Net ?

Thanks,
Joannes Vermorel



==== Build Output Error Message ====

Compiling...
Stdafx.cpp
Compiling...
selfscaling.cpp
ModalHistogramIterator.cpp
ModalHistogram.cpp
ListHistogramIterator.cpp
histogram-utils.cpp
histogram-utils.cpp(111) : warning C4018: '>' : signed/unsigned mismatch
histogram-utils.cpp(112) : warning C4018: '<' : signed/unsigned mismatch
histogram-utils.cpp(188) : warning C4018: '<' : signed/unsigned mismatch
histogram-utils.cpp(191) : warning C4018: '<' : signed/unsigned mismatch
histogram-user.cpp
EquiProbableHistogramIterator.cpp
EquiProbableHistogram.cpp
EquiErrorHistogramIterator.cpp
EquiErrorHistogram.cpp
AssemblyInfo.cpp
ArrayHistogramIterator.cpp
Generating Code...
Linking...
ModalHistogram.obj : error LNK2001: unresolved external symbol "void __cdecl
operator delete(void *)" (??3@$$FYAXPAX@Z)
ModalHistogramIterator.obj : error LNK2019: unresolved external symbol "void
__cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function
"class HistogramIterator * __cdecl newModeIterator(double *,struct
histogramMode_ *,double,double,int)"
(?newModeIterator@@YAPAVHistogramIterator@@PANPAUh istogramMode_@@NNH@Z)
EquiProbableHistogramIterator.obj : error LNK2001: unresolved external
symbol "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
histogram-user.obj : error LNK2001: unresolved external symbol "void __cdecl
operator delete(void *)" (??3@$$FYAXPAX@Z)
histogram-utils.obj : error LNK2019: unresolved external symbol "void
__cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function
"double __cdecl rfloor(double)" (?rfloor@@YANN@Z)
ListHistogramIterator.obj : error LNK2001: unresolved external symbol "void
__cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
ArrayHistogramIterator.obj : error LNK2001: unresolved external symbol "void
__cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
EquiErrorHistogram.obj : error LNK2019: unresolved external symbol "void
__cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function
"public: __thiscall EquiErrorHistogram::EquiErrorHistogram(int)"
(??0EquiErrorHistogram@@$$FQAE@H@Z)
EquiErrorHistogramIterator.obj : error LNK2019: unresolved external symbol
"void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in
function "public: __thiscall
EquiErrorHistogramIterator::EquiErrorHistogramIter ator(int,int,int,int
*,double *,int *)" (??0EquiErrorHistogramIterator@@QAE@HHHPAHPAN0@Z)
EquiProbableHistogram.obj : error LNK2001: unresolved external symbol "void
__cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
EquiProbableHistogramIterator.obj : error LNK2001: unresolved external
symbol "void __stdcall `eh vector destructor iterator'(void *,unsigned
int,int,void (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
ListHistogramIterator.obj : error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
ModalHistogram.obj : error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
ModalHistogramIterator.obj : error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
ArrayHistogramIterator.obj : error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
EquiErrorHistogram.obj : error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
EquiErrorHistogramIterator.obj : error LNK2001: unresolved external symbol
"void __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
EquiProbableHistogram.obj : error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
ModalHistogram.obj : error LNK2019: unresolved external symbol __purecall
referenced in function "public: __thiscall
ModalHistogram::ModalHistogram(int)" (??0ModalHistogram@@QAE@H@Z)
ModalHistogramIterator.obj : error LNK2001: unresolved external symbol
__purecall
ArrayHistogramIterator.obj : error LNK2001: unresolved external symbol
__purecall
EquiProbableHistogram.obj : error LNK2001: unresolved external symbol
__purecall
EquiProbableHistogramIterator.obj : error LNK2001: unresolved external
symbol __purecall
ListHistogramIterator.obj : error LNK2019: unresolved external symbol
__purecall referenced in function "public: virtual void * __thiscall
ListHistogramIterator::`vector deleting destructor'(unsigned int)"
(??_EListHistogramIterator@@UAEPAXI@Z)
ModalHistogram.obj : error LNK2001: unresolved external symbol "void *
__cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
ModalHistogramIterator.obj : error LNK2001: unresolved external symbol "void
* __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
EquiErrorHistogram.obj : error LNK2001: unresolved external symbol "void *
__cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
EquiProbableHistogram.obj : error LNK2001: unresolved external symbol "void
* __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
histogram-utils.obj : error LNK2001: unresolved external symbol "void *
__cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
ListHistogramIterator.obj : error LNK2001: unresolved external symbol "void
* __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
EquiErrorHistogram.obj : error LNK2001: unresolved external symbol "void
__cdecl __CxxCallUnwindDtor(void (__thiscall*)(void *),void *)"
(?__CxxCallUnwindDtor@@$$J0YAXP6EXPAX@Z0@Z)
EquiErrorHistogramIterator.obj : error LNK2001: unresolved external symbol
"void __cdecl __CxxCallUnwindDtor(void (__thiscall*)(void *),void *)"
(?__CxxCallUnwindDtor@@$$J0YAXP6EXPAX@Z0@Z)
EquiErrorHistogram.obj : error LNK2001: unresolved external symbol "double
__cdecl fabs(double)" (?fabs@@$$J0YANN@Z)
EquiProbableHistogram.obj : error LNK2001: unresolved external symbol
"double __cdecl fabs(double)" (?fabs@@$$J0YANN@Z)
histogram-utils.obj : error LNK2001: unresolved external symbol "double
__cdecl fabs(double)" (?fabs@@$$J0YANN@Z)
ModalHistogram.obj : error LNK2001: unresolved external symbol "double
__cdecl fabs(double)" (?fabs@@$$J0YANN@Z)
EquiProbableHistogram.obj : error LNK2001: unresolved external symbol "int *
__cdecl _errno(void)" (?_errno@@$$J0YAPAHXZ)
histogram-user.obj : error LNK2001: unresolved external symbol "int __cdecl
fputc(int,struct _iobuf *)" (?fputc@@$$J0YAHHPAU_iobuf@@@Z)
histogram-utils.obj : error LNK2001: unresolved external symbol "double
__cdecl floor(double)" (?floor@@$$J0YANN@Z)
ModalHistogram.obj : error LNK2019: unresolved external symbol "double
__cdecl floor(double)" (?floor@@$$J0YANN@Z) referenced in function "void
__cdecl initModeDescriptor(struct histogramMode_ *)"
(?initModeDescriptor@@YAXPAUhistogramMode_@@@Z)
histogram-utils.obj : error LNK2001: unresolved external symbol "double
__cdecl fmod(double,double)" (?fmod@@$$J0YANNN@Z)
ModalHistogram.obj : error LNK2019: unresolved external symbol "double
__cdecl fmod(double,double)" (?fmod@@$$J0YANNN@Z) referenced in function
"public: __thiscall ModalHistogram::ModalHistogram(int)"
(??0ModalHistogram@@$$FQAE@H@Z)
histogram-utils.obj : error LNK2001: unresolved external symbol "double
__cdecl ceil(double)" (?ceil@@$$J0YANN@Z)
histogram-utils.obj : error LNK2001: unresolved external symbol "double
__cdecl sqrt(double)" (?sqrt@@$$J0YANN@Z)
ModalHistogram.obj : error LNK2019: unresolved external symbol "double
__cdecl sqrt(double)" (?sqrt@@$$J0YANN@Z) referenced in function "public:
virtual void __thiscall ModalHistogram::newDataPoint(double)"
(?newDataPoint@ModalHistogram@@$$FUAEXN@Z)
histogram-utils.obj : error LNK2001: unresolved external symbol "int __cdecl
printf(char const *,...)" (?printf@@$$J0YAHPBDZZ)
fatal error LNK1120: 13 unresolved externals





Joannes Vermorel
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Linking problem when porting C++ to .Net


I finally solved the problem by myself. The dependency "msvcrt.lib" was
missing from the project settings.

Joannes

"Joannes Vermorel" <firstname@lastname.com> wrote in message
news:uL8QARyUEHA.484@TK2MSFTNGP10.phx.gbl...[color=blue]
> I am currently trying to port a small open source scientfic library[/color]
written[color=blue]
> in C++ to .Net. The code (including the VS solution) could be found at
> http://www.vermorel.com/opensource/selfscaling.zip
>
> My problem is that when I try to compile the library I got a list of[/color]
linking[color=blue]
> error messages. I am not a specialist of porting C++ code to .Net. Does
> anyone has an idea on how to make this code compile in .Net ?
>
> Thanks,
> Joannes Vermorel
>
>
>
> ==== Build Output Error Message ====
>
> Compiling...
> Stdafx.cpp
> Compiling...
> selfscaling.cpp
> ModalHistogramIterator.cpp
> ModalHistogram.cpp
> ListHistogramIterator.cpp
> histogram-utils.cpp
> histogram-utils.cpp(111) : warning C4018: '>' : signed/unsigned mismatch
> histogram-utils.cpp(112) : warning C4018: '<' : signed/unsigned mismatch
> histogram-utils.cpp(188) : warning C4018: '<' : signed/unsigned mismatch
> histogram-utils.cpp(191) : warning C4018: '<' : signed/unsigned mismatch
> histogram-user.cpp
> EquiProbableHistogramIterator.cpp
> EquiProbableHistogram.cpp
> EquiErrorHistogramIterator.cpp
> EquiErrorHistogram.cpp
> AssemblyInfo.cpp
> ArrayHistogramIterator.cpp
> Generating Code...
> Linking...
> ModalHistogram.obj : error LNK2001: unresolved external symbol "void[/color]
__cdecl[color=blue]
> operator delete(void *)" (??3@$$FYAXPAX@Z)
> ModalHistogramIterator.obj : error LNK2019: unresolved external symbol[/color]
"void[color=blue]
> __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function
> "class HistogramIterator * __cdecl newModeIterator(double *,struct
> histogramMode_ *,double,double,int)"
> (?newModeIterator@@YAPAVHistogramIterator@@PANPAUh istogramMode_@@NNH@Z)
> EquiProbableHistogramIterator.obj : error LNK2001: unresolved external
> symbol "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
> histogram-user.obj : error LNK2001: unresolved external symbol "void[/color]
__cdecl[color=blue]
> operator delete(void *)" (??3@$$FYAXPAX@Z)
> histogram-utils.obj : error LNK2019: unresolved external symbol "void
> __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function
> "double __cdecl rfloor(double)" (?rfloor@@YANN@Z)
> ListHistogramIterator.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
> ArrayHistogramIterator.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
> EquiErrorHistogram.obj : error LNK2019: unresolved external symbol "void
> __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function
> "public: __thiscall EquiErrorHistogram::EquiErrorHistogram(int)"
> (??0EquiErrorHistogram@@$$FQAE@H@Z)
> EquiErrorHistogramIterator.obj : error LNK2019: unresolved external symbol
> "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in
> function "public: __thiscall
> EquiErrorHistogramIterator::EquiErrorHistogramIter ator(int,int,int,int
> *,double *,int *)" (??0EquiErrorHistogramIterator@@QAE@HHHPAHPAN0@Z)
> EquiProbableHistogram.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
> EquiProbableHistogramIterator.obj : error LNK2001: unresolved external
> symbol "void __stdcall `eh vector destructor iterator'(void *,unsigned
> int,int,void (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
> ListHistogramIterator.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
> (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
> ModalHistogram.obj : error LNK2001: unresolved external symbol "void
> __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
> (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
> ModalHistogramIterator.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
> (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
> ArrayHistogramIterator.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
> (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
> EquiErrorHistogram.obj : error LNK2001: unresolved external symbol "void
> __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
> (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
> EquiErrorHistogramIterator.obj : error LNK2001: unresolved external symbol
> "void __stdcall `eh vector destructor iterator'(void *,unsigned[/color]
int,int,void[color=blue]
> (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
> EquiProbableHistogram.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
> (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
> ModalHistogram.obj : error LNK2019: unresolved external symbol __purecall
> referenced in function "public: __thiscall
> ModalHistogram::ModalHistogram(int)" (??0ModalHistogram@@QAE@H@Z)
> ModalHistogramIterator.obj : error LNK2001: unresolved external symbol
> __purecall
> ArrayHistogramIterator.obj : error LNK2001: unresolved external symbol
> __purecall
> EquiProbableHistogram.obj : error LNK2001: unresolved external symbol
> __purecall
> EquiProbableHistogramIterator.obj : error LNK2001: unresolved external
> symbol __purecall
> ListHistogramIterator.obj : error LNK2019: unresolved external symbol
> __purecall referenced in function "public: virtual void * __thiscall
> ListHistogramIterator::`vector deleting destructor'(unsigned int)"
> (??_EListHistogramIterator@@UAEPAXI@Z)
> ModalHistogram.obj : error LNK2001: unresolved external symbol "void *
> __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
> ModalHistogramIterator.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> * __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
> EquiErrorHistogram.obj : error LNK2001: unresolved external symbol "void *
> __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
> EquiProbableHistogram.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> * __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
> histogram-utils.obj : error LNK2001: unresolved external symbol "void *
> __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
> ListHistogramIterator.obj : error LNK2001: unresolved external symbol[/color]
"void[color=blue]
> * __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z)
> EquiErrorHistogram.obj : error LNK2001: unresolved external symbol "void
> __cdecl __CxxCallUnwindDtor(void (__thiscall*)(void *),void *)"
> (?__CxxCallUnwindDtor@@$$J0YAXP6EXPAX@Z0@Z)
> EquiErrorHistogramIterator.obj : error LNK2001: unresolved external symbol
> "void __cdecl __CxxCallUnwindDtor(void (__thiscall*)(void *),void *)"
> (?__CxxCallUnwindDtor@@$$J0YAXP6EXPAX@Z0@Z)
> EquiErrorHistogram.obj : error LNK2001: unresolved external symbol "double
> __cdecl fabs(double)" (?fabs@@$$J0YANN@Z)
> EquiProbableHistogram.obj : error LNK2001: unresolved external symbol
> "double __cdecl fabs(double)" (?fabs@@$$J0YANN@Z)
> histogram-utils.obj : error LNK2001: unresolved external symbol "double
> __cdecl fabs(double)" (?fabs@@$$J0YANN@Z)
> ModalHistogram.obj : error LNK2001: unresolved external symbol "double
> __cdecl fabs(double)" (?fabs@@$$J0YANN@Z)
> EquiProbableHistogram.obj : error LNK2001: unresolved external symbol "int[/color]
*[color=blue]
> __cdecl _errno(void)" (?_errno@@$$J0YAPAHXZ)
> histogram-user.obj : error LNK2001: unresolved external symbol "int[/color]
__cdecl[color=blue]
> fputc(int,struct _iobuf *)" (?fputc@@$$J0YAHHPAU_iobuf@@@Z)
> histogram-utils.obj : error LNK2001: unresolved external symbol "double
> __cdecl floor(double)" (?floor@@$$J0YANN@Z)
> ModalHistogram.obj : error LNK2019: unresolved external symbol "double
> __cdecl floor(double)" (?floor@@$$J0YANN@Z) referenced in function "void
> __cdecl initModeDescriptor(struct histogramMode_ *)"
> (?initModeDescriptor@@YAXPAUhistogramMode_@@@Z)
> histogram-utils.obj : error LNK2001: unresolved external symbol "double
> __cdecl fmod(double,double)" (?fmod@@$$J0YANNN@Z)
> ModalHistogram.obj : error LNK2019: unresolved external symbol "double
> __cdecl fmod(double,double)" (?fmod@@$$J0YANNN@Z) referenced in function
> "public: __thiscall ModalHistogram::ModalHistogram(int)"
> (??0ModalHistogram@@$$FQAE@H@Z)
> histogram-utils.obj : error LNK2001: unresolved external symbol "double
> __cdecl ceil(double)" (?ceil@@$$J0YANN@Z)
> histogram-utils.obj : error LNK2001: unresolved external symbol "double
> __cdecl sqrt(double)" (?sqrt@@$$J0YANN@Z)
> ModalHistogram.obj : error LNK2019: unresolved external symbol "double
> __cdecl sqrt(double)" (?sqrt@@$$J0YANN@Z) referenced in function "public:
> virtual void __thiscall ModalHistogram::newDataPoint(double)"
> (?newDataPoint@ModalHistogram@@$$FUAEXN@Z)
> histogram-utils.obj : error LNK2001: unresolved external symbol "int[/color]
__cdecl[color=blue]
> printf(char const *,...)" (?printf@@$$J0YAHPBDZZ)
> fatal error LNK1120: 13 unresolved externals
>
>[/color]


Closed Thread