help with wrapping this code
-
i thought it would be better to make a new tread for this one. i am trying to get this code to work, but i don't know what i'm doing wrong.. i know this much.... i have a class library(.net) called fooManaged and its automatical created fooManaged.h. and i created UnManaged.h in the UnManaged.h file i have this code..... #include iostream #include vcclr.h using namespace std; class Foo { public: Foo(); ~Foo(); void DoSomeFoo(); }; // constructor Foo::Foo() { cout<<"Constructor called!"<DoSomeFoo(); } } the fooManaged.cpp file just has... #include "stdafx.h" #include "Unmanagedfoo.h" #include "fooManaged.h" #using mscorlib.dll it all compiles...but there is a big linking error!! Compiling... fooManaged.cpp Linking... LINK : error LNK2020: unresolved token (0A000005) _CxxThrowException LINK : error LNK2020: unresolved token (0A000019) free LINK : error LNK2020: unresolved token (0A00001A) strlen LINK : error LNK2020: unresolved token (0A00001B) memmove LINK : error LNK2020: unresolved token (0A00001C) memcpy LINK : error LNK2020: unresolved token (0A00001D) delete LINK : fatal error LNK1120: 6 unresolved externals i must be doing something wrong, some help with this will be very wecome thanks
-
i thought it would be better to make a new tread for this one. i am trying to get this code to work, but i don't know what i'm doing wrong.. i know this much.... i have a class library(.net) called fooManaged and its automatical created fooManaged.h. and i created UnManaged.h in the UnManaged.h file i have this code..... #include iostream #include vcclr.h using namespace std; class Foo { public: Foo(); ~Foo(); void DoSomeFoo(); }; // constructor Foo::Foo() { cout<<"Constructor called!"<DoSomeFoo(); } } the fooManaged.cpp file just has... #include "stdafx.h" #include "Unmanagedfoo.h" #include "fooManaged.h" #using mscorlib.dll it all compiles...but there is a big linking error!! Compiling... fooManaged.cpp Linking... LINK : error LNK2020: unresolved token (0A000005) _CxxThrowException LINK : error LNK2020: unresolved token (0A000019) free LINK : error LNK2020: unresolved token (0A00001A) strlen LINK : error LNK2020: unresolved token (0A00001B) memmove LINK : error LNK2020: unresolved token (0A00001C) memcpy LINK : error LNK2020: unresolved token (0A00001D) delete LINK : fatal error LNK1120: 6 unresolved externals i must be doing something wrong, some help with this will be very wecome thanks
Add msvcrt.lib to the linker options.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
-
Add msvcrt.lib to the linker options.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
-
i dont know how to do that, so i guessed at added msvcrt.lib to the command line in addional options in the linker properties, but i get even more errors!
Project's Property Pages dialog box -> Linker->Input. Add msvcrt.lib to the Additional Dependencies.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
-
Project's Property Pages dialog box -> Linker->Input. Add msvcrt.lib to the Additional Dependencies.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
thanks man, i've done that but i am stil getting errors when linking, just two though... Linking... libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z) libcpmtd.lib(_tolower.obj) : error LNK2001: unresolved external symbol __malloc_dbg libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z) C:\Documents and Settings\Major Pigeon\My Documents\Visual Studio Projects\fooManaged\Debug\fooManaged.dll : fatal error LNK1120: 2 unresolved externals