Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Linking Issue #49

@samielhini

Description

@samielhini

I am almost certain I am doing something wrong.

I do not get this error for luna::server but when I reference luna::router I get the following during linking:

CMakeFiles/GlacierHardwareController.dir/Webserver.cpp.o: In function Webserver::Webserver(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': /home/sami.elhini/Code/glacierhardwarecontrollerv2/Webserver.cpp:13: undefined reference to luna::router::router(std::__cxx11::basic_string<char, std::char_traits, std::allocator >)'
collect2: error: ld returned 1 exit status
CMakeFiles/GlacierHardwareController.dir/build.make:307: recipe for target 'bin/GlacierHardwareController' failed
make[2]: *** [bin/GlacierHardwareController] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/GlacierHardwareController.dir/all' failed
make[1]: *** [CMakeFiles/GlacierHardwareController.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

CMakeLists.txt Excerpt:

set(CMAKE_CXX_STANDARD 14)
if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
else()
message(WARNING "The file conanbuildinfo.cmake doesn't exist, you have to run conan install first")
endif()

target_link_libraries(GlacierHardwareController ${LIBS} ${CONAN_LIBS})

Code Excerpt:

Webserver::Webserver(const int port, const std::string directory) {
this->port = port;
luna::router rtr("/");
//luna::router router{"/"};
//assets.serve_files("/", directory);
//srv.add_router(assets);
}

void Webserver::run(){

srv.start(this->port);

}

conanfile.txt

[requires]
luna/4.0.0@DEGoodmanWilson/stable
nl-json/2.1.1@genvidtech/1.4.0

[generators]
cmake

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions