Skip to content

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

Open

Description

@mAhmedBappi

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?

Activity

  1. mrozigor commented on Jul 10, 2020

    @mrozigor

    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).

  2. mAhmedBappi commented on Jul 10, 2020

    @mAhmedBappi
    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();

  3. mAhmedBappi commented on Jul 10, 2020

    @mAhmedBappi
    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!

  4. mrozigor commented on Jul 10, 2020

    @mrozigor

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

  5. mAhmedBappi commented on Jul 11, 2020

    @mAhmedBappi
    Author

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

    Screenshot 2020-07-11 at 8 58 15 AM

  6. mrozigor commented on Jul 11, 2020

    @mrozigor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions