Using Botan library with Eclispse - c++

I am trying to use botan library with eclipse. I have compiled botan using Ubuntu and I created small program as follow
#include <botan/botan.h>
int main()
{
LibraryInitializer init;
return 0;
}
But I have got fatal error: botan/build.h: No such file or directory
Thanks in advance and waiting for help.

You need to add to your gcc command line the -lbotan option in order to compile correctly.

Related

FATAL ERRORS with compilation after installing Aspose.Cells library for C++

Can someone please help me with my issue with Aspose.Cells library for C++?
I was writing my first C++ programme using Aspose.Cells library. Everything seemed smooth except that the following error was produced after I built the file:
Error before I launch is:
"Error exist in a required project.Continue launch?"
Error after running the code is:
"**fatal error: boost/config/compiler/gcc.hpp: No such file or directory**".**
If I commented out the line #<include Aspose.Cells.h>, the file can run with no errors.
I tried to solve the error by installing Boost library for C++ from zip file "boost_1_73_0", as I think Aspose depends on Boost to run. However, I couldn't link to Boost successfully as there doesn't seem to be a "include" folder and "lib" folder for me to add into project properties.
My questions are:
Will installing Boost solve my problem?
If yes, how can I install Boost library successful?
The following is my code in C++. Thanks a Lot in advance!
#include <iostream>
#include <Aspose.Cells.h>
using namespace std;
int main() {
cout << "!!!I am little red!!!" << endl;
return 0;
}
Regards
Hillary
UPDATE: I have successfully installed and linked Boot library now but I have got three warning message upon building: "Ignoring #pragma warning [-wunknown-pragmas]" , are these warning messages serious?
I also ran into another fatal error: unicode/uloc.h:No such file or directory. How can I correctly link up to unilib-master/Unicode library?
Yes, installing Boost helps.
If Aspose only requires header-only libraries from Boost, then you don't have to do much. The "include" path you're looking for is just the folder where you extracted the zip. The actual library headers are under boost/ in that folder, which are then found by the compiler.
If you need the shared libraries, you will need to build them. Follow the steps here Getting Started On Windows

Undefined reference to std::*something* when linking library staticly

I've compiled some of my code into a static library. Everything from this library begins with Glow or GLOWE prefix. At the moment, I'm testing the library in Linux (Ubuntu 14.04). I made a simple program to check if I did everything correctly.
#include <GlowSystem/Package.h>
int main(void)
{
GLOWE::Package package;
return 0;
}
GLOWE::Package is a class. It uses libzip and zlib (and standard c++ files eg. string). I link both libzip and zlib. When I try to compile, it fails with some linking errors.
Build log (at pastebin)
I thought that these errors are caused by too old libstdc++, but this code compiles:
#include <string>
using namespace std;
int main(void)
{
string a;
a.resize(5000);
return 0;
}
I'm at my wits' end and I have no idea what to do. I will appreciate any help.
It looks like your linker options are incorrect:
../GlowE/GlowEngine/bin/Debug/libGlowEngine.a /usr/lib/x86_64-linux-gnu/libzip.a /usr/lib/x86_64-linux-gnu/libz.a
Try:
-l../GlowE/GlowEngine/bin/Debug/GlowEngine -l/usr/lib/x86_64-linux-gnu/zip -l/usr/lib/x86_64-linux-gnu/z

Reading From OGR error in c++

I'm trying to compile the following code using the gdal libraries in Centos 7:
The name of the file is rungdal.cpp
#include "/usr/include/gdal/ogrsf_frmts.h"
int main(){
// Register all format drivers
GDALAllRegister();
}
I run the program using: g++ rungdal.cpp -o rungdal, and I have the following message:
error: ‘GDALAllRegister’ was not declared in this scope
I also include the whole path from the header file, if I don't use it the program doesn't work, maybe it's something related.
What can I do for executing the program?
Thanks for your help!
I fixed the code with your suggestions:
#include <gdal/gdal.h>
int main(){
// Register all format drivers
GDALAllRegister();
}
In addition, I have to add the line -lgdal for the compilation and it works.
g++ rungdal.cpp -o rungdal -lgdal
Thanks for your help!
Alvaro

linking jsoncpp on Ubuntu

I try to use jsoncpp library with c++ on Ubuntu.
I compiled the code and built the library with scons.
Now I can compile a simple programme:
#include "json/json.h"
#include <json/value.h>
#include <json/writer.h>
int main()
{
return 0;
}
I use this command to compile:
g++ test.cpp -usr/lib/libjson_linux-gcc-4.8_libmt
I conclude that the compiler knows where to find the library.
The problem comes when I declare a json object:
Json::Value root;
Then I have this error message:
undefined reference to « Json::Value::Value(Json::ValueType) »
How can I fix this problem?
For CodeBlocks (Ubuntu 14.04)
I have faced same problem in my codeblocks IDE after installing jsconcpp. This is how I rectified my problem.
Got to project>Build Options>linker settings and in the link libraries add jsconcpp and click ok

Boost compilation error with python

I'm new to the boost C++ library and I'm trying to use boost with python. Whenever I compile my simple test program I get an error:
error: pyconfig.h: No such file or dirctory
(followed by thousand more errors which I'm sure are because of this missing header).
I downloaded boost from it's website and then built the library. I still have no idea why that file is missing and how to get it. Please help!
I'm using code::blocks MinGW compiler and I have pointed code blocks to the boost folder as a search directory for headers as well as libraries.
Here's my simple program:
#include <boost/python.hpp>
using namespace boost::python;
int main()
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print ’Today is’,ctime(time())\n");
Py_Finalize();
return 0;
}
You apparently do not have the CPython headers in your include path. Just having boost::python is not enough, you need Python itself, too.