Berkeley DB(Unable to Locate Component) - c++

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

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.

Related

Build error when using Mac C++ to connect to sqlite3

I am attempting to learn how to connect to sqlite3 using C++ on a Mac Xcode compiler.
I have the following include files..
#include <iostream>
#include "sqlite3.h"
I have tried the two sqlite3 open functions…
sqlite3_open and sqlite3_open_v2
The Xcode tool finds no errors until I try to compile. Then I get a “Build Failed” error with no further explanation.
What is the likely cause and how can I track down the error?
The likely cause is your code is incorrect (eg. #include "sqlite3.h" should be #include <sqlite3.h>, etc). Without posting the exact error nobody here can tell you specifically why.
How to track down the error is pointed out in the documention:
Choose View > Navigators > Show Log Navigator to view the reports that
Xcode generates during your development process. Alternatively, you
can click the log navigator button
in the navigator selector bar of the workspace window.
↳ Finding and Fixing Issues from the Log Viewer

Why does "cout" keep giving me error C1083?

I was using Visual C++ 6.0 just now, and I keep getting this error:
fatal error C1083: Cannot open include file: 'streambuf': No such file or directory
My code is just a simple hello world program.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
cout<<"Hello World.";
return 1;
}
Then I went and checked my INCLUDE folder and found a file called STREAMBF, but the compiler was looking for STREAMBUF. Notice that the file that is present is missing the U, between the B and the F. This was from a good copy of VC++6.0, directly from the actual CD, not a pirated copy. So there should be all the files needed. But it appears that a file is missing! Is this MS being stupid again, and yet making another big mistake, and forgetting to include an important file on their CDs? I'd hate to think that every single CD for VC++6.0 that was pressed that came out of MS factories had this problem. And I know that it is a missing file, not just a misnamed file, as renaming STREAMBF to STREAMBUF just led to more errors.
Anybody know where I can find a copy of the file STREAMBUF? Or am I just overlooking something here? Is this exact error a known problem with running old copies of VC++ on modern OS's like Windows 7? Is it possible that the only reason that it's looking for STREAMBUF is that this is a newer file associated with Win7, and that if it was running in a different environment (an older OS), it would actually be looking for the correct file, STREAMBF? Can somebody help me here?
Your installation is either broken, deprecated or interpretes your code in wrong way.
You should only use older compiles if you are trying to build project developed entirely for this version.
Try to compile same code with new compiler, if you want to use VS then you should look for Visual Studio Express 2013.
Your code does not have any errors.
Modify your program to, you should be able to see it okay.
#include <iostream.h>
using namespace std;
int main()
{
cout<<"Hello World.";
return 1;
}
However,
your compiler is pretty old. You need to an upgrade.
There are C++ compilers for Windows from Microsoft Express Visual Studios Link and Info VS2013 to
some other non-Microsoft like GCC for Windows.
If you don't have installation access there are some portable c++ compilers.
Finally there are some online compilers for simple test. web based online compilers.
For my win 10 installation of VC 6.0, I had the same problem ... fatal error C1083: Cannot open include file: 'streambuf': No such file or directory
Replacing with <iostream.h> does not solve the problem.
I have checked the header file installation folder (Program files\VS98\VC98\INCLUDE). For some (unknown) reason, some file names have been changed during installation. Restoring the original name has solved the problem, in my case, in example:
Turn STREAMBF into STREAMBUF, STDXCEPT into STDEXCEPT, XCEPTION into EXCEPTION, FCTIONAL into FUNCTIONAL.
Notice: other header file names might be wrong. I have listed above the file names wrong in my installation.
I hope this may help.

How to connect to Oracle in C++?

I tried to connect to Oracle using C++ but it is giving me error stating that DBManger.h not found. I have also tried using occi.h but got the same error of not found or No Such Directory.
I have installed Oracle 11g and it contains the OCI Liabraries also.
I located the specififc folders also where the OCI libraries are present . In my system they are at location E:\app\user\product\11.1.0\db_1\OCI\lib\MSVC\vc8.
I have also set the Path starting with Oracle home. But, still my program is not able to find the header files.
Any help would be greatly appreciated? I Googled a lot but found the same solution stating that locate the folder where the OCI libraries are available. I am posting my code below written in Visual Studio 2008:
I have written a very small script and just included the header files. Not even done the connectivity:
#include <occi.h>
#include <iostream>
using namespace oracle::occi;
using namespace std;
class DataBaseConnectionTest
{
public:
void test()
{
cout<<"Hello from test"<<'\n';
}
};
void main()
{
DataBaseConnectionTest *dbc=new DataBaseConnectionTest();
dbc->test();
}
Modify your project properties, add the E:\app...vc8 directory name to the Addition include directories. It's under C++/General. No need to double every \ in that one.
You'll probably need a similar treatment for the OCI library file anyway. The include file is only half the puzzle, the other half is the LIB.
You could consider OTL as alternative to OCI. Then your code could be more portable. I used it many years ago, interfacing SqlServer, and was surprised by the clean design and the raw speed (way faster than MFC+ODBC...). Also, I had a problem and Sergei gave me immediate assistance.

boost problem in windows 7

I have written the following code
#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem.hpp>
#include <boost/system/windows_error.hpp>
using namespace boost::system;
int main(){
boost::asio::io_service io;
boost::asio::deadline_timer t(io,boost::posix_time::seconds(5));
t.wait();
std::cout<<"hello world";
return 0;
}
and I get the following error:
1>LINK : fatal error LNK1104: cannot open file 'libboost_system-vc100-mt-gd-1_44.lib'
I dont know how and what do, can you please explain what is happening and what steps I can take to fix it?
Ok, for MSVC++ 2010
Under Project Properties, goto
Configuration Properties -> Linker -> General -> Additional Library Directories and add there the path to the *.lib file (For example: C:\boost_1_41_0\stage\lib)
As far as I can tell from the error message it compiles but can't find the boost compiled libraries.
These you have to build yourselves unless you can find them prebuilt.
IIRC boost are built using a tool called bjam. I think this explains it rather throughly: http://www.highscore.de/cpp/boostbuild/index.html.
After it's built you have to instruct the compiler to link it using the project properties.
I suspect you haven't built the libraries. You can get the pre-built libraries from BoostPro or you can build them yourself following the instructions at http://www.boost.org/doc/libs/1_44_0/more/getting_started/windows.html
I was working in one instance of Visual Studio 2010. When I started up another, to scrawl out a bit of code, I was shocked to see the same error message. Reset includes and lib (Project->NameofProject Properties then select VC++ Directories) and toggled back and forth between debug and release, at first just once, then a few more times, as I grew increasingly alarmed at none of this working.
Even though the IDE didn't report any activity ('Build Failed,' was all it said in the place where it shows includes/libs being enumerated) after a few minutes (of furious web browsing) I came back to discover that it had silently self-fixed.

MS Visual C++ 2008 Express cannot find path

I'm trying to do something basic
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}
After using F7 I get
1>mt.exe : general error c10100b1: Failed to load file "..\Debug\helloworld.exe". The system cannot find the path specified.
So it cant find the file that it'll eventually create?
What gives?
mt.exe is the manifest tool. The manifest tool shouldnt run if there is a build error. I dont think you will see mt.exe run if there is a build error. Go to your solution file, under the manifest tab, check if the path's in the settings are not hard coded to some wrong path.
#include <.iostream.>
Did your build really succeed? The above line looks suspicious - I'd have expected to see (note the missing periods):
#include <iostream>