dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: BerkeleyDB and Visual C++ .NET 2005 problem

  1. #1
    Join Date
    May 2006
    Posts
    21

    BerkeleyDB and Visual C++ .NET 2005 problem

    Hi
    I've just downloaded and installed the most new version of Oracle BerkeleyDB (msi packet). No I'm trying to include <db_cxx.h> header file in my project (after set correct folders for includes and libs in VC++ options). I'm still getting error:

    1>c:\program files (x86)\oracle\berkeley db 4.6.19\include\db.h(1402) : error C2143: syntax error : missing '}' before '('
    1>c:\program files (x86)\oracle\berkeley db 4.6.19\include\db.h(1402) : fatal error C1903: unable to recover from previous error(s); stopping compilation

    I think it's becouse of DBTYPE enum type - the same name as the one from oledb.h. But I don't see (after "find in project" ) that i'm including oledb.h to my project.

    Maybe some of you are using BerkeleyDB with VisualC++ - I'll be very happy to see some solution of my problem.

    Best regards...
    AragornX

    PS
    Solution given in FAQ on Oracle site (one with #define) doesn't work 'cuz I don't have any "oledb.h" included...
    Last edited by aragornx; August 28th, 2007 at 05:31 AM.

  2. #2
    Join Date
    May 2006
    Posts
    21

    Re: BerkeleyDB and Visual C++ .NET 2005 problem

    I found solution:

    #define DBTYPE BDBTYPE
    #undef DB_UNKNOWN
    #include <db_cxx.h>
    #undef DBTYPE

    but I don't if it is correct ??

  3. #3
    Join Date
    May 2006
    Posts
    21

    Re: BerkeleyDB and Visual C++ .NET 2005 problem

    In fact, after my changes it works until db.open. Now I have linker error:

    error LNK2019: unresolved external symbol "public: virtual int __thiscall Db:pen(class DbTxn *,char const *,char const *,enum BDBTYPE,unsigned int,int) [...]

    I also triad to compile BerkeleyDB by myself - and there was no errors (while compiling code from Oracle). But it was the same story with DBTYPE ...

    still not working ...

    PS
    Of course I have libdb46.lib included in my project ...
    Last edited by aragornx; August 28th, 2007 at 07:08 AM.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,248

    Re: BerkeleyDB and Visual C++ .NET 2005 problem

    What type of Visual C++ project is this? Have you tried doing using the lib from a simple console app?

  5. #5
    Join Date
    May 2006
    Posts
    21

    Re: BerkeleyDB and Visual C++ .NET 2005 problem

    It is Visual C++ 2005 Windows Application MFC Project...

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,248

    Re: BerkeleyDB and Visual C++ .NET 2005 problem

    Take a look at the stdafx.h files that's created for you in the MFC project and comment out some of the default #include statements. I would try creating a console app and try the db there. If it works in the console, you can then track down the include conflicts in the MFC projects. If it doesn't work, you'll know it's in the Berkeley end.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)