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

CMake compiling with oatapp linking issues #64

Open
schnitzlein opened this issue May 18, 2022 · 1 comment
Open

CMake compiling with oatapp linking issues #64

schnitzlein opened this issue May 18, 2022 · 1 comment

Comments

@schnitzlein
Copy link

Hi thanks for that great project! 👍

I am using arm toolchain with cmake and simply install oatpp and oatpp-swagger to /opt/... folder.

But meanwhile compile process some Error occured.
If I not compile it with cmake and make than the main project only finds oatpp.
The oatpp works fine, but I am not able to link the oatpp-swagger into project, no matter what I am trying.

Current compile error:
firmware/oatpp-swagger/build$ make DESTDIR=/opt/ARM/binary/oatpp-swagger install [ 50%] Built target oatpp-swagger [ 62%] Building CXX object test/CMakeFiles/module-tests.dir/oatpp-swagger/ControllerTest.cpp.o In file included from /home/csc/Documents/Projects/Viessmann/git/with_swagger/hems_firmware/oatpp-swagger/test/oatpp-swagger/ControllerTest.cpp:7: /home/csc/Documents/Projects/Viessmann/git/with_swagger/hems_firmware/oatpp-swagger/test/oatpp-swagger/test-controllers/TestController.hpp: In member function ‘void TestController::Z__ENDPOINT_ADD_INFO_deleteUser(const std::shared_ptr<oatpp::web::server::api::Endpoint::Info>&)’: /home/csc/Documents/Projects/Viessmann/git/with_swagger/hems_firmware/oatpp-swagger/test/oatpp-swagger/test-controllers/TestController.hpp:255:39: error: no matching function for call to ‘oatpp::web::server::api::Endpoint::Info::addResponse(const oatpp::web::protocol::http::Status&)’ 255 | info->addResponse(Status::CODE_500); | ^ In file included from /home/csc/Documents/Projects/Viessmann/git/hems_firmware/oatpp/include/oatpp-1.3.0/oatpp/oatpp/web/server/api/ApiController.hpp:28, from /home/csc/Documents/Projects/Viessmann/git/with_swagger/hems_firmware/oatpp-swagger/test/oatpp-swagger/test-controllers/TestController.hpp:8, from /home/csc/Documents/Projects/Viessmann/git/with_swagger/hems_firmware/oatpp-swagger/test/oatpp-swagger/ControllerTest.cpp:7: /home/csc/Documents/Projects/Viessmann/git/hems_firmware/oatpp/include/oatpp-1.3.0/oatpp/oatpp/web/server/api/Endpoint.hpp:247:19: note: candidate: ‘template<class Wrapper> oatpp::web::server::api::Endpoint::Info::ContentHints& oatpp::web::server::api::Endpoint::Info::addResponse(const oatpp::web::protocol::http::Status&, const String&, const String&)’ 247 | ContentHints& addResponse(const oatpp::web::protocol::http::Status& status, const oatpp::String& contentType, const oatpp::String& responseDescription = oatpp::String()) { | ^~~~~~~~~~~ /home/csc/Documents/Projects/Viessmann/git/hems_firmware/oatpp/include/oatpp-1.3.0/oatpp/oatpp/web/server/api/Endpoint.hpp:247:19: note: template argument deduction/substitution failed: In file included from /home/csc/Documents/Projects/Viessmann/git/with_swagger/hems_firmware/oatpp-swagger/test/oatpp-swagger/ControllerTest.cpp:7: /home/csc/Documents/Projects/Viessmann/git/with_swagger/hems_firmware/oatpp-swagger/test/oatpp-swagger/test-controllers/TestController.hpp:255:39: note: candidate expects 3 arguments, 1 provided 255 | info->addResponse(Status::CODE_500); | ^ make[2]: *** [test/CMakeFiles/module-tests.dir/build.make:76: test/CMakeFiles/module-tests.dir/oatpp-swagger/ControllerTest.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:142: test/CMakeFiles/module-tests.dir/all] Error 2 make: *** [Makefile:141: all] Error 2

@schnitzlein
Copy link
Author

solved with the CMake Flag : cmake -DCMAKE_TOOLCHAIN_FILE=../../Toolchain-RPi/toolchain.cmake -DOATPP_BUILD_TESTS=False ..

I spend some time in linking, and I was happy to get to the actual compiling point, because it shows me that the linking was successfull -> Test fails :D :)

Anyway.

Thanks for this project.

Solved

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

1 participant