Can't include mysql - c++

I have been trying for a while now. I have been asked to do a few modifications on a big program, and it requires a lot of libs. All of them were succesfully added, except mysql.
I downloaded the libs several times and tried a lot of times.
I am on Windows using Netbeans and C++.
The test I decided to do is simple: create an empty program and try to include mysql. I didn't have any success:
#include <cstdlib>
#include <mysql/mysql.h>
using namespace std;
int main(int argc, char** argv) {
return 0;
}
This program won't work even if I replace #include <mysql/mysql.h> with #include <mysql.h>.
The error NetBeans gives me is the following:
main.cpp:15:25: fatal error: mysql/mysql.h: No such file or directory
These images show how I altered the project options on Linker and C/C++ options:
Parameters
The folder showing on the C image does contain a mysql.h, i triple checked twice.
I also have added the paths with includes to CodeAssistance.
Many similar questions were left unanswered for years now on several forums, even on stackoverflow, and I can't seem to work this out. This thread may have a final answer to those of us who stumble upon this.

It is not able to find the file
At this point, your program would be pointing to something like this:
cl /I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
mysql1.c
So you needed to include the directory that contains mysql.h as well. So the above would changed to:
cl /I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
/I "C:\Program Files\MySQL\MySQL Server 5.5\include" mysql1.c

verify the header file exist in the path /usr/include/mysql/mysql.h or installed some where else. If you have installed the header files somewhere else ( add that location with -I/.

Related

cannot open include file 'Graphics.hpp' no such file or directory ,additional include for visual studio not working

i m trying to use sfml in my project using visual studio 2019. Following sfml documentation to perform setup for visual studio i have performed all the action required
i have included include folder in c/c++/additional include directory and also provided path for lib folder in linker setting and also provided additional dependencies in linker/input
but
#include <iostream>
#include <SFML/Graphics.hpp>
int main()
{
std::cout << "i cant tolerate" << std::endl;
return 0;
}
this code shows above mentioned error ,
cannot open include file 'Graphics.hpp' no such file or directory
it seems like include path is not working
how can i solve this issue
i tried many times but got same result
if anyone facing the same problem please check the platform in the project/properties win32 worked for my particular problem

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.

Microsoft Visual Studios 2012 Can't open "python33.lib"

I'm using the Boost libraries in MicroSoft Visual Studios 2012 for a C++ program that is going to have Python embedded into it. The problem is when I try to Build Solution [F7]; I get this ::
Error 1 error LNK1104: cannot open file 'python33.lib' C:\Users\usr\Documents\Visual Studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\LINK
The problem is, I have no idea what this is, means, or any clue of how to fix it.
I have already tried to move my python folder into my Desktop, as it was originally in the C:\, I thought maybe it was a permissions error, but that didn't do anything.
Here is my code from a tutorial that I was reading in preparation for the porject::
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <boost/lambda/lambda.hpp>
#include <boost/python.hpp>
using namespace boost::python;
int main( int argc, char ** argv ) {
try {
Py_Initialize();
object main_module((
handle<>(borrowed(PyImport_AddModule("__main__")))));
object main_namespace = main_module.attr("__dict__");
handle<> ignored(( PyRun_String( "print \"Hello, World\"",
Py_file_input,
main_namespace.ptr(),
main_namespace.ptr() ) ));
} catch( error_already_set ) {
PyErr_Print();
}
}
--Visual Studios 2012
--Windows 7 x64
--Python 3.3.2
--Boost libraries
--Python Embedded C++ program
--Link to tutorial page:: http://wiki.python.org/moin/boost.python/EmbeddingPython
Thanks for all the help David.
For anyone else who runs into this problem, here's what you need to do.
Right click on the Project name (ConsoleApplication1, ect) and under C/C++ general insure that your additional include directories include youe python include, Lib, and libs folders. As well as the boost root and the boost lib(32/64) folder.
Under the linker menu, in the input sub catagory, for additional dependencies, you'll need to add this into there.
C:\Python33\libs\python33.lib
C:\boost_1_54\lib32-msvc-11.0\boost_python-vc110-mt-gd-1_54.lib
Or whatever your install directory is. As well as any other required files.
Once that's done your project should build.
Once you're ready to run it you'll need to copy whatever .dll files are needed into the folder where the executable is built.

C++ Problems with #include <anyfile.h> when trying to compile a gstreamer app

I didn't find anything like this when I searched for it. I'm trying to make a simple gstreamer app based on code I found in another stack overflow thread. Whenever I try to compile it by going to the directory with command prompt and entering cl cppgstreamer.cc. Initially, the only include was #include <gstreamermm.h>, which gives me
cppgstreamer.cc(1) : fatal error C1083: Cannot open include file: 'gstreamermm.h
': No such file or directory
Even when I put cppgstreamer.cc into the same directory as gstreamermm.h. I then tried changing the include to
#include "C:\Users\MY_NAME\Documents\gstreamer c++\gstreamermm-0.10.10.2\gstreamer\gstreamermm.h"
with MY_NAME being replaced by my name.
This seems to work, but then it tries to do the includes in the gstreamermm.h, and they are in #include <file.h> form, so I get another fatal error C1083,except this time with init.h, or when I changed that, error.h. And they have dependencies. Is there a way that I can get my compiler to like the #include <file.h> syntax? I really don't want to go through the file and change every #include <file.h> to #include "file.h".
Sorry if this is a dumb question. I'm new to C++, although I've worked with C in the past.
I am using Microsoft Visual C++ Express 2010. Any help would be appreciated. Thanks!
You need to add the directory containing gstreamermm.h to include path. I don't have visual c++ here to check, but it's in somewhere in project properties under C/C++ .

Need help in C++ with allegro library....?

I installed CodeBlocks 10.5 with minGW compiler. After setting environment variables for minGW I cheked gcc -v on cmd and it is working fine.
The problem is that, I have made a small program in CodeBlocks project the code is below
#include <iostream>
#include <allegro5/allegro.h>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
There is an error, the build log is:
Compiling: main.cpp
C:\Program Files\CodeBlocks\MinGW\bin\allegro_pract… error: allegro5/allegro.h: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
Directory structure for codeblocks is:
C:\Program Files\CodeBlocks
and for minGW:
C:\Program Files\CodeBlocks\mingw
and my project is:
C:\Program Files\CodeBlocks\bin\
i am confused about allegro library where to place it.. as I have not used any external library..
the library is placed now at:
C:\Program Files\CodeBlocks\mingw\allegro\
I am "Googling" for a long time but no tutorial seems to be working..
please give a valid solution.. and where to place allegro library..??
Do not try to "place" libraries in the "right place". Instead, tell the IDE where you put them explicitly. This is called setting the include path.
Code::Blocks should have some setting for include directories. You should point it to the place where Allegro lives.
Set up your IDE to look for Allegro:
(source: allegro.cc)
The complete tutorial is here:
http://wiki.allegro.cc/index.php?title=Windows,_Code::Blocks_10.05_and_Allegro_5
http://www.mingw.org/wiki/IncludePathHOWTO:
The actual search path, for any specific installation of MinGW may be determined, by running the compiler itself, with the "-v" option; typically, for a GCC-3.4.5 installation in c:/mingw:--
defaults appear to be:
c:/mingw/include/c++/3.4.5
c:/mingw/include/c++/3.4.5/mingw32
c:/mingw/include/c++/3.4.5/backward
c:/mingw/include
c:/mingw/lib/gcc/mingw32/3.4.5/include
I don't use mingw, so, read the link.