Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. help with wrapping this code

help with wrapping this code

Scheduled Pinned Locked Moved Managed C++/CLI
helpcsharpc++
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fu Manchu
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • F Fu Manchu

      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

      N Offline
      N Offline
      Nemanja Trifunovic
      wrote on last edited by
      #2

      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.

      F 1 Reply Last reply
      0
      • N Nemanja Trifunovic

        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.

        F Offline
        F Offline
        Fu Manchu
        wrote on last edited by
        #3

        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!

        N 1 Reply Last reply
        0
        • F Fu Manchu

          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!

          N Offline
          N Offline
          Nemanja Trifunovic
          wrote on last edited by
          #4

          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.

          F 1 Reply Last reply
          0
          • N Nemanja Trifunovic

            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.

            F Offline
            F Offline
            Fu Manchu
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups