Berkeley DB(Unable to Locate Component)

2019-08-31 03:47发布

问题:

I have a problem with berkeley DB. I get a dialog titled "Unable To Locate Componenent" saying "This application has failed to start because libdb48.dll was not found. Re-installing the application may fix this problem", then it crashes after clicking ok. I got the error message when running these simple code below:

#include <iostream>
#include <string>
#include <db_cxx.h>

using namespace std;

int main()
{
    Db db(0, 0);
}

I already set the Additional include directories to the "build_windows" directory and I have linked to the "libdb48.lib". I honestly do not know what to do here. The funny part is, I googled and I had 0 pages returned.

I am using visual studio c++ 2008 and Berkeley DB 4.8.24

Thanks

回答1:

Where is libdb48.dll? Is it installed? Where? A hackish solution that should make it work is to copy libdb48.dll into c:\windows\system32. If that solves the problem, then you know that the DLL just wasn't on the path. Then you can find a more appropriate place to put it.