Building Warble connect.cpp example

Hello,

I am having issues with a missing library when trying to compile connect.cpp in the Warble examples on mblientlab Github.

I build on the command line (on the Pi) using :
g++ -o connect example/connect.cpp -std=c++14 -Isrc -Ldist/release/lib/x64 -lwarble

but the library does not exist where -lwarble is looking (/usr/bin/ld)

Boost and BlueZ are both installed and the compiler works and instructions for getting Warble to work were successful in Python, but I am looking to just us c/c++.

Comments

  • Did you build warble? It so, where is "libwarble.so" relative to your current working directory?

  • It is located in /dist/release/lib/arm

    Do I need to create a symbolic link for it the appropriate folder for it to find?
    or specifying the path in the command line when compiling? (i.e. -L/dist/release/lib/arm/libwarble.so)
    Tried that last part, and didn't find, but unsure of the syntax I used.

  • edited May 2019

    I've tried setting the individual library path and also tried to set directory of libraries

    $g++ -o connect example/connect.cpp -std=c++14 -Isrc -Ldist/release/lib/x64 -l/dist/release/lib/arm/libwarble.so

    $g++ -o connect example/connect.cpp -std=c++14 -Isrc -Ldist/release/lib/x64 -L/dist/release/lib/arm

    Also, the directory ( dist/release/lib/x64) doesn't appear to be there, as shown in the picture below

  • edited May 2019

    @R0b0t1c5 said:
    It is located in /dist/release/lib/arm

    So copy the original library path and replace "x64" with "arm".

  • Finally getting back to this part, and tried it. I looked at both symbolic links in /dist/release/lib/arm (i.e. libwarble.so and libwarble.so.1) and they point to the libwarble.so.1.1.5 executable located in the same folder. Tried

    g++ -o connect example/connect.cpp -std=c++14 -Isrc -Ldist/release/lib/x64 -l-ldist/release/arm/libwarble.so

    but still get the /usr/bin/ld: cannot find -ldist/release/arm/libwarble.so

    I see in the original compile command from: https://github.com/mbientlab/Warble/blob/master/example/connect.cpp
    is as follows:

    compile: g++ -o connect example/connect.cpp -std=c++14 -Isrc -Ldist/release/lib/x64 -lwarble

    It has the -lwarble command at the end. Is there suppose to be a file or soft link to a file called warble in the working directory?

  • Isn't the soft link what @Eric said?

  • edited May 2019

    @R0b0t1c5 said:
    I see in the original compile command from: https://github.com/mbientlab/Warble/blob/master/example/connect.cpp
    is as follows:

    compile: g++ -o connect example/connect.cpp -std=c++14 -Isrc -Ldist/release/lib/x64 -lwarble

    Quoting myself...

    @Eric said:

    @R0b0t1c5 said:
    It is located in /dist/release/lib/arm

    So copy the original library path and replace "x64" with "arm".

  • I apologize for the bad post, it was a result of copy and pasting on my part, forgot to change the "x64" to "arm" in my most recent post. I did try the change mentioned by you, but the result was as mentioned in my most recent post. Command line input is shown below

    g++ -o connect example/connect.cpp -std=c++14 -Isrc -Ldist/release/lib/arm -l-ldist/release/arm/libwarble.so

    Again, sorry for not reviewing my most recent post for errors.

  • Ignore the extra -l in there before -ldist

  • @R0b0t1c5 said:
    I apologize for the bad post, it was a result of copy and pasting on my part, forgot to change the "x64" to "arm" in my most recent post. I did try the change mentioned by you, but the result was as mentioned in my most recent post. Command line input is shown below

    g++ -o connect example/connect.cpp -std=c++14 -Isrc -Ldist/release/lib/arm -l-ldist/release/arm/libwarble.so

    Again, sorry for not reviewing my most recent post for errors.

    The original command line argument is -lwarble.so, why is it changed to -ldist/release/arm/libwarble.so? All I said to do is update the library path.

Sign In or Register to comment.