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. Using Static Libraries in Managed C++

Using Static Libraries in Managed C++

Scheduled Pinned Locked Moved Managed C++/CLI
c++csharpvisual-studioquestion
3 Posts 3 Posters 1 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.
  • T Offline
    T Offline
    THULLA
    wrote on last edited by
    #1

    We have some static libraries created long time back say 10/15 yrs back. We have build all the libraries in visual studio 2005. But when we create a managed C++ application and try to use classes from the static libraries , the application just crashes with no traces as to why did the application crash. Application crashes in dbgheap.c. the static libraries which we use have reference to ATL as well. With the same set of project settings if a create MFC application in Visual studio 2005 everything seems to be working fine. Questions: 1. Is it possible for managed C++ application to use static libraries , if yes then what is to be done. 2.What are the options use a static library in managed code.

    L G 2 Replies Last reply
    0
    • T THULLA

      We have some static libraries created long time back say 10/15 yrs back. We have build all the libraries in visual studio 2005. But when we create a managed C++ application and try to use classes from the static libraries , the application just crashes with no traces as to why did the application crash. Application crashes in dbgheap.c. the static libraries which we use have reference to ATL as well. With the same set of project settings if a create MFC application in Visual studio 2005 everything seems to be working fine. Questions: 1. Is it possible for managed C++ application to use static libraries , if yes then what is to be done. 2.What are the options use a static library in managed code.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      I have not used static linking for years. If it turns out there is some problem with that you might consider turning the libraries into DLLs. We have several projects using old code from DLL libraries that work just fine.

      1 Reply Last reply
      0
      • T THULLA

        We have some static libraries created long time back say 10/15 yrs back. We have build all the libraries in visual studio 2005. But when we create a managed C++ application and try to use classes from the static libraries , the application just crashes with no traces as to why did the application crash. Application crashes in dbgheap.c. the static libraries which we use have reference to ATL as well. With the same set of project settings if a create MFC application in Visual studio 2005 everything seems to be working fine. Questions: 1. Is it possible for managed C++ application to use static libraries , if yes then what is to be done. 2.What are the options use a static library in managed code.

        G Offline
        G Offline
        Gordon Brandly
        wrote on last edited by
        #3

        Ah, I've been reading this forum for months, waiting for a question I could actually answer. :-D At least, I hope I can answer it. If, when you say "managed C++", you actually mean C++/CLI, then the answer is yes. I have written a couple of test applications that statically link one of my native-code libraries to a C++/CLI application that uses managed code. I had some trouble getting static variables in the library to initialize properly, which caused various crashes. I was an MSDN subscriber at the time, and I got a solution from the MSDN-only forums in a matter of days -- I was impressed. If you're trying to link to a C++/CLI application and you have static variables in your library, I'd be happy to send you the workaround. If you're using the old Managed C++ or don't have any static variables in your library, then I can't help you, sorry.

        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