4 Replies Latest reply: Sep 18, 2011 1:08 PM by 885512 RSS

    Embed BDB XML into VS2010 project

    885512
      Hello,

      I have downloaded BDB XML (bundle: Berkeley DB XML 2.5.16.msi).
      Now, I would like to embed it in my existing Visual Studio 2010 project.

      What do I need to take from the distribution (.lib, .exe , .dll, headers, ...)
      and where shall I put them in my VS2010 project?
      How do I compile and then link the whole?

      Any help would be greatly appreciated!
      Best regards,
      --
      Léa
        • 1. Re: Embed BDB XML into VS2010 project
          885512
          Compilation works, linking fails.

          Here is what I did for compilation to work:
          "Project"
          -> "<project_name> Properties..."
          -> "VC++ Directories"
          -> "Include Directories"
          I added:
          <BDB_XML_HOME>\include
          <BDB_XML_HOME>\include\dbxml

          --
          Léa
          • 2. Re: Embed BDB XML into VS2010 project
            885512
            Here is my very basic program:

            #include <iostream>
            using namespace std;

            #include "DbXml.hpp"
            using namespace DbXml;

            int main()
            {
                 cout << "Begin \n";
                 XmlManager myManager;
                 cout << "End \n";
                 return 0;
            }
            • 3. Re: Embed BDB XML into VS2010 project
              885512
              Notice that at runtime, "<BDB_XML_HOME>\bin" is part of the "PATH" environment variable.
              Here is how I check that:
              --------------------------------------------------------
              char * pPath;
              pPath = getenv ("PATH");
              if(pPath!=NULL)
              printf("The current path is: %s\n", pPath);
              --------------------------------------------------------



              The error message is:
              --------------------------------------------------------
              1>hello.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall DbXml::XmlManager::~XmlManager(void)" (__imp_??1XmlManager@DbXml@@QAE@XZ)

              1>hello.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall DbXml::XmlManager::XmlManager(void)" (__imp_??0XmlManager@DbXml@@QAE@XZ)

              1><WHERE_MY_VC2010_PROJ_RESIDES>\hello\Debug\hello.exe : fatal error LNK1120: 2 unresolved externals

              1>Build FAILED.
              --------------------------------------------------------
              (Same in "Release").
              • 4. Re: Embed BDB XML into VS2010 project
                885512
                Ok. I think it works now...

                Here is what I did:
                -----------------------------------------
                "Project"
                -> "<project_name> Properties..."
                -> "Linker"
                -> "Input"
                -> "Additional Dependencies"

                And I added the four following paths:
                - <BDB_XML_HOME>\lib\libdb48.lib
                - <BDB_XML_HOME>\lib\libdbxml25.lib
                - <BDB_XML_HOME>\lib\xerces-c_3.lib
                - <BDB_XML_HOME>\lib\xqilla22.lib
                -----------------------------------------