-
Notifications
You must be signed in to change notification settings - Fork 22
Linking Issue #49
Comments
Ok that’s weird! I’ll look into that, thanks for raising it! |
Definitely. I really like your coding style and would be thrilled to get this working. I suppose I can experiment with a project with fewer dependencies. I have a fair number of CMAKE dependencies. I would think namespaces would avoid collisions and it is bizarre that only that class does not seem to produce a linkable symbol. Could it be a C dependency without an extern "C" block? |
stdint.h is included by types.h. Types.h does not have it in an extern C block and stdint.h does not seem to have an extern C block either. Just a thought. |
Reproduced with a totally clean project with no other dependencies. See attached. |
Will work on replicating and fixing this morning. Thank you for the replication case! |
Could you tell me what OS and compiler you are using, BTW? |
Just to eliminate some possibilities, let's do this to your conanfile. At the moment, the only version of Luna that stands a change of compiling is 5.0.0. 4.0.0 won't fly. Change your conanfile to look like this:
Now, go clone the Luna repo to your local machine, and inside the luna directory, do this:
This will put a private build on your machine so you can tinker with Luna locally, and have those changes reflected in your test program. Every time you make a change to luna, just re-run the As it stands, like this, I get one build error right off the bat, that I am going to submit a fix for now, a missing header file in the package deployment! |
OK, that build error is fixed, and with those changes to the conanfile, I am able to get your sample compiling, linking, and running under OS X. |
I will give it a try. I am on Debian 9. I actually do all my other coding work on a Mac but use Debian when I work on my embedded code. |
Quite strange: canning dependencies of target TestLuna I will note that I had to use --build missing with my Conan install file for CMake. |
That's super weird. Do you have, or can you recommend, a Docker image or other VM image that I can use to try to replicate your environment? It looks like symbols aren't getting exported from the Luna library… |
Hi Don,
I have a relatively HUGE VMWARE image. I may try to create a Docker image, rerun the build, and if I experience the same issue find a way to get that Docker image to you.
Sami
…Sent from my iPhone
On Mar 16, 2018, at 10:21, Don Goodman-Wilson ***@***.***> wrote:
That's super weird. Do you have, or can you recommend, a Docker image or other VM image that I can use to try to replicate your environment? It looks like symbols aren't getting exported from the Luna library…
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
👍 |
Latest push of 5.0.0/testing is a big improvement. Precompiled binaries are even available if you clear our your conan cache! But there is a problem, in that you'll get a nasty runtime error the first time you try to serve an endpoint:
This is a problem with libmime and/or conan-mime-db, and I'm now seeking help from the conan folks on this: |
ok @samielhini everything seems to be working now! Try your sample program again, and let me know how it works. |
Does this error make any sense to you: /home/sami.elhini/Code/TestLuna/main.cpp:8:27: error: ‘luna::router::router(std::__cxx11::string)’ is protected within this context |
Yes. The API for creating You now create a
the |
CMakeFiles/TestLuna.dir/main.cpp.o: In function `main':
/home/sami.elhini/Code/TestLuna/main.cpp:9: undefined reference to
`luna::server::create_router(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >)'
/home/sami.elhini/.conan/data/luna/5.0.0/DEGoodmanWilson/testing/package/4cffdb6638500871653f6e1b565c3871f90aed9d/lib/libluna.a(response_renderer.cpp.o):
In function `luna::get_mime_type_(std::string const&)':
/home/conan/.conan/data/luna/5.0.0/DEGoodmanWilson/testing/build/4cffdb6638500871653f6e1b565c3871f90aed9d/luna/private/response_renderer.cpp:38:
undefined reference to `mime::get_extension_from_path(std::string)'
/home/conan/.conan/data/luna/5.0.0/DEGoodmanWilson/testing/build/4cffdb6638500871653f6e1b565c3871f90aed9d/luna/private/response_renderer.cpp:38:
undefined reference to `mime::content_type(std::string const&)'
…On Wed, Mar 21, 2018 at 12:33 PM, Don Goodman-Wilson < ***@***.***> wrote:
Yes. The API for creating router objects has changed. Sorry ;)
You now create a router like this:
auto router = server.create_router("/");
the router instance is now a pointer, so you'll need to use
router->handle_request() instead of router.handle_request().
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC__Pj3SobmyPbjsKdvknGo89Mb435brks5tgoDNgaJpZM4SndDR>
.
--
Sami Elhini
IEEE Certified Biometrics Professional
President
Creatrix, Inc
P: 844-200-CRTX (2789)
M: 443-745-5164
F. 844-900-CRTX (2789)
[email protected]
http://www.creatrixinc.com
|
Hrm, I need more context. Can you share with me what your main.cpp looks like? |
#include <iostream>
#include <luna/luna.h>
int main() {
std::cout << "Hello, World!" << std::endl;
luna::server server;
auto router = server.create_router("/");
server.start(7999);
return 0;
}
…On Wed, Mar 21, 2018 at 12:58 PM, Don Goodman-Wilson < ***@***.***> wrote:
Hrm, I need more context. Can you share with me what your main.cpp looks
like?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC__PtAqJGVOsQV2iDj54R9FtKvJVX8-ks5tgobLgaJpZM4SndDR>
.
--
Sami Elhini
IEEE Certified Biometrics Professional
President
Creatrix, Inc
P: 844-200-CRTX (2789)
M: 443-745-5164
F. 844-900-CRTX (2789)
[email protected]
http://www.creatrixinc.com
|
Hrm, there's a couple of things that might be going on. Can you do this for me?
to clear our the conan cache, then try a |
This might be easier to copy and paste:
|
I still get the same issue.
I am using CLion and CMake. I tried you instructions both from the room of
my project and from the cmake-build-debug.
So the first time I just ran everything you posted in the root.
The second time I changed into cmake-build-debug. Ran the conan remove
commands. Changed back up and then ran: conan install . -s
build_type=Debug --install-folder=cmake-build-debug
That step is necessary or CLion will not be able to see the include
directories.
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.9)
project(TestLuna)
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()
add_executable(TestLuna main.cpp)
target_link_libraries(TestLuna ${CONAN_LIBS} -pthread)
…On Wed, Mar 21, 2018 at 1:09 PM, Don Goodman-Wilson < ***@***.***> wrote:
This might be easier to copy and paste:
conan remove -f luna/*
conan remove -f base64/*
conan remove -f gmp/*
conan remove -f jsonformoderncpp/*
conan remove -f libgpg-error/*
conan remove -f libiconv/*
conan remove -f mime-db/*
conan remove -f zlib/*
conan remove -f libgcrypt/*
conan remove -f libmime/*
conan remove -f nettle/*
conan remove -f gnutls/*
conan remove -f libmicrohttpd/*
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC__PjQuGuI9ZCEw4AeBW6iWX9iffkB6ks5tgokwgaJpZM4SndDR>
.
--
Sami Elhini
IEEE Certified Biometrics Professional
President
Creatrix, Inc
P: 844-200-CRTX (2789)
M: 443-745-5164
F. 844-900-CRTX (2789)
[email protected]
http://www.creatrixinc.com
|
OK, I can replicate in a Docker container based on |
Going to try to bring in a little help in solving this mystery: conan-io/conan#2658 |
OK, @samielhini try this: Clear our your conan cache again. then: let me know how that works! |
Maybe it's because I don't know what I'm doing.
I am assuming because my cmake build directory is cmake-build-debug I have
to run the remove command in directory (I also ran it in the root just for
good measure) and also the specify that directory for the install command.
conan install . -s build_type=Debug --install-folder=cmake-build-debug -s
compiler.libcxx=libstdc++11
This is what I get when I run make in my cmake build folder:
CMakeFiles/TestLuna.dir/main.cpp.o: In function `main':
/home/sami.elhini/Code/TestLuna/main.cpp:9: undefined reference to
`luna::server::create_router(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >)'
/home/sami.elhini/.conan/data/gnutls/3.6.2/DEGoodmanWilson/stable/package/d73561b73a3220c26bc453e0d85e04da2c71a143/lib/libgnutls.a(sysrng-linux.o):
In function `have_getrandom':
/home/conan/.conan/data/gnutls/3.6.2/DEGoodmanWilson/stable/build/d73561b73a3220c26bc453e0d85e04da2c71a143/sources/lib/nettle/sysrng-linux.c:73:
undefined reference to `getrandom'
/home/sami.elhini/.conan/data/gnutls/3.6.2/DEGoodmanWilson/stable/package/d73561b73a3220c26bc453e0d85e04da2c71a143/lib/libgnutls.a(sysrng-linux.o):
In function `force_getrandom':
/home/conan/.conan/data/gnutls/3.6.2/DEGoodmanWilson/stable/build/d73561b73a3220c26bc453e0d85e04da2c71a143/sources/lib/nettle/sysrng-linux.c:87:
undefined reference to `getrandom'
collect2: error: ld returned 1 exit status
CMakeFiles/TestLuna.dir/build.make:94: recipe for target 'bin/TestLuna'
failed
make[2]: *** [bin/TestLuna] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/TestLuna.dir/all'
failed
make[1]: *** [CMakeFiles/TestLuna.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
…On Fri, Mar 23, 2018 at 12:52 PM, Don Goodman-Wilson < ***@***.***> wrote:
OK, @samielhini <https://github.com/samielhini> try this:
Clear our your conan cache again. then:
conan install . -s compiler.libcxx=libstdc++11
let me know how that works!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC__Pifhzc-vvvW5WxkWIfmT9aXVNYPBks5thShHgaJpZM4SndDR>
.
--
Sami Elhini
IEEE Certified Biometrics Professional
President
Creatrix, Inc
P: 844-200-CRTX (2789)
M: 443-745-5164
F. 844-900-CRTX (2789)
[email protected]
http://www.creatrixinc.com
|
Doesn't matter where you do the removal from. Can you send me the output of running |
Configuration for profile default:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=6
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
…On Sat, Mar 24, 2018 at 2:29 PM, Don Goodman-Wilson < ***@***.***> wrote:
Doesn't matter where you do the removal from. Can you send me the output
of running
conan profile show default ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC__PkP9MRjYHkpe7dQz_qGzkuM1M1Saks5thpCkgaJpZM4SndDR>
.
--
Sami Elhini
IEEE Certified Biometrics Professional
President
Creatrix, Inc
P: 844-200-CRTX (2789)
M: 443-745-5164
F. 844-900-CRTX (2789)
[email protected]
http://www.creatrixinc.com
|
Ok. Last thing: can you verify that you removed |
Yes. Verified. I tried the removes and build again.
…On Sun, Mar 25, 2018 at 4:56 AM, Don Goodman-Wilson < ***@***.***> wrote:
Ok. Last thing: can you verify that you removed gnutls/*?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC__PhNiYPZ2nIeRI8h-j-4IhMuk_qkwks5th1vEgaJpZM4SndDR>
.
--
Sami Elhini
IEEE Certified Biometrics Professional
President
Creatrix, Inc
P: 844-200-CRTX (2789)
M: 443-745-5164
F. 844-900-CRTX (2789)
[email protected]
http://www.creatrixinc.com
|
OK, TBH I'm at a bit of a loss. I've tried this now in a docker container (based on After re-running Can you try removing all the intermediate CMake files? Failing that, would you mind taking the rather drastic step of removing also |
@samielhini One other thing you can try is building with these commands:
to force the right standard library. Let me know how this is working for you. |
I'm a bit swamped at the moment but may have some time tomorrow or later
this week to give this a shot. Thanks for all the help!
…On Tue, Mar 27, 2018 at 8:09 AM, Don Goodman-Wilson < ***@***.***> wrote:
@samielhini <https://github.com/samielhini> One other thing you can try
is building with these commands:
conan install . -s compiler.libcxx=libstdc++11
cmake . -DCONAN_LIBCXX=libstdc++11
cmake --build .
to force the right standard library. Let me know how this is working for
you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC__PuFOG0E438um7mBYAzsOySU5e_83ks5tiiv4gaJpZM4SndDR>
.
--
Sami Elhini
IEEE Certified Biometrics Professional
President
Creatrix, Inc
P: 844-200-CRTX (2789)
M: 443-745-5164
F. 844-900-CRTX (2789)
[email protected]
http://www.creatrixinc.com
|
We’ll get this working one way or another! Hang in there. |
All good. I'm patient. I have all the time in the world.
…On Tue, Mar 27, 2018 at 2:08 PM, Don Goodman-Wilson < ***@***.***> wrote:
We’ll get this working one way or another! Hang in there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC__PmxOGMsQbrd6FTscZTWX1AabvQMKks5tioAcgaJpZM4SndDR>
.
--
Sami Elhini
IEEE Certified Biometrics Professional
President
Creatrix, Inc
P: 844-200-CRTX (2789)
M: 443-745-5164
F. 844-900-CRTX (2789)
[email protected]
http://www.creatrixinc.com
|
Closing, stale. Reopen if the problem comes back up! |
This problem reared it's head again in #74 It appears that some kernel versions don't provide the |
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(){
}
conanfile.txt
[requires]
luna/4.0.0@DEGoodmanWilson/stable
nl-json/2.1.1@genvidtech/1.4.0
[generators]
cmake
The text was updated successfully, but these errors were encountered: