Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crow_all.h gives large number of errors when i compile my main.cpp file #382

Open
mAhmedBappi opened this issue Jul 10, 2020 · 6 comments
Open

Comments

@mAhmedBappi
Copy link

Platform: macOS Catalina 10.15.4.
g++ --version:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

main.cpp:

#include
#include "crow_all.h"

using namespace std;

int main(){
crow::SimpleApp app;
CROW_ROUTE(app, "/")({
return "Hello world";
});
app.port(3000).multithreaded().run();
}

command to compile:

g++ -o main main.cpp

There are alot of error massages and warnings shown by the compiler when i run the g++ command. Why is it giving these errors?

@mrozigor
Copy link

Could you fix formatting? What kind of errors? Did you include all needed libraries? Look at example CMake file (https://github.com/ipkn/crow/blob/master/examples/CMakeLists.txt).

@mAhmedBappi
Copy link
Author

Hey! The following error comes when i try to build the project using cmake.

what i did:

clone git repo,
cd crow
mkdir build
cd build
cmake ..
make

when i do the above i get the following error:

/Desktop/crow/include/crow/socket_adaptors.h:22:28: error: no
member named 'get_io_service' in
'boost::asio::basic_stream_socket<boost::asio::ip::tcp,
boost::asio::executor>'
return socket_.get_io_service();

@mAhmedBappi
Copy link
Author

Can you please tell the whole process from cloning the repo to building it to linking it to a project to running the "hello world" program in simple steps!

@mrozigor
Copy link

Probably you have newer Boost installed. Try building from my repo (https://github.com/mrozigor/crow) - patch is already applied there.

@mAhmedBappi
Copy link
Author

did the same process as described above using your repo. The following error occured:

Screenshot 2020-07-11 at 8 58 15 AM

@mrozigor
Copy link

This looks like Mac specific problem -> https://stackoverflow.com/a/58719834/2568147

Possibly you can try to move line 17 (endif()) to line 28 (after add_custom_target(example_ws_copy... (https://github.com/mrozigor/crow/blob/master/examples/CMakeLists.txt). It shouldn't then build targets with dependencies to OpenSSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants