restc-cpp icon indicating copy to clipboard operation
restc-cpp copied to clipboard

Issue while compiling

Open juansebastiani2cat opened this issue 4 years ago • 1 comments

I have built the library (With several of the tests failing) and then I created a simple hello world project:

#include <iostream>
#include <boost/lexical_cast.hpp>
#include <boost/fusion/adapted.hpp>
#include </home/i2cat/Downloads/restc-cpp/include/restc-cpp/restc-cpp.h>
#include </home/i2cat/Downloads/restc-cpp/include/restc-cpp/SerializeJson.h>
#include </home/i2cat/Downloads/restc-cpp/include/restc-cpp/RequestBuilder.h>
using namespace std;
int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

But on the compilation stage, the following error appears:

image

I am running Ubuntu 20.04 LTS

juansebastiani2cat avatar Apr 07 '22 17:04 juansebastiani2cat

When you build the library with cmake, config.h is created and contains the relevant build options needed to use the other headers with the compiled library. It is important to make sure to either install or include the project in a way where this file is preserved.

For example, in k8deployer I use restc-cpp as an included cmake project. You can see how that is done here: https://github.com/jgaa/k8deployer/blob/820d4844d485f3e6d323cd23684b4e6551d4d599/cmake/external-projects.cmake#L12

Regarding the tests, only the unit-tests will pass unless you have docker-compose installed and start the functional test back-end suite.

jgaa avatar Apr 11 '22 15:04 jgaa