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. How do I store object files as a library??

How do I store object files as a library??

Scheduled Pinned Locked Moved Managed C++/CLI
helpquestioncsharpc++visual-studio
2 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.
  • B Offline
    B Offline
    BenPage
    wrote on last edited by
    #1

    Hi there. I downloaded a matrix arithmetic library, Newmat10, and are struggling to get it to work. The author says that it would work fine with MS Visual Studio 2003, which is what I am using. The library consists of a lot of cpp files which have to be compiled. This part I get right. Then all I have to do is include the main header file >> newmatap.h, in the project where I want to use the matrix functions. So I include the header file in the project where I want to use the functions and it compiles. But the moment I use one of the functions of the library, I get a lot of error messages that looks like this: TestNewMat.obj : error LNK2019: unresolved external symbol "public: __thiscall Matrix::Matrix(int,int)" (??0Matrix@@QAE@HH@Z) referenced in function _main. What am I doing wrong? The author said something about it being best to store the resulting object files ( the ones you get when you compile the source files of the library) as a library. How does that work? Any help would be appreciated!! Thank you.

    C 1 Reply Last reply
    0
    • B BenPage

      Hi there. I downloaded a matrix arithmetic library, Newmat10, and are struggling to get it to work. The author says that it would work fine with MS Visual Studio 2003, which is what I am using. The library consists of a lot of cpp files which have to be compiled. This part I get right. Then all I have to do is include the main header file >> newmatap.h, in the project where I want to use the matrix functions. So I include the header file in the project where I want to use the functions and it compiles. But the moment I use one of the functions of the library, I get a lot of error messages that looks like this: TestNewMat.obj : error LNK2019: unresolved external symbol "public: __thiscall Matrix::Matrix(int,int)" (??0Matrix@@QAE@HH@Z) referenced in function _main. What am I doing wrong? The author said something about it being best to store the resulting object files ( the ones you get when you compile the source files of the library) as a library. How does that work? Any help would be appreciated!! Thank you.

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      BenPage wrote: The library consists of a lot of cpp files which have to be compiled Do you compile them as a separate library ? Or do you want to add all the files to your project ? BenPage wrote: What am I doing wrong? It's normal that it doesn't work: you have just included the header files in your project thus the linker doesn't find the 'code' for the functions. You have two solutions: either include the .cpp to your project also OR, if you want to use that in a separate library, go in the project settings (don't remember exactly where) and you have somewhere to tell that your project uses the library you compiled (don't forget to copy it to your project folder). Hope this helps

      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