libcflie
libcflie copied to clipboard
Compiling against using makefile
Hi,
I'm trying to link against the library but I'm having some trouble during compilation with a makefile. I believe the issue is that its not link the libusb-1.0 library since I get the following error:
//usr/local/lib/libcflie.a(CCrazyRadio.cpp.o): In function CCrazyRadio::CCrazyRadio(std::string)': CCrazyRadio.cpp:(.text+0x87): undefined reference to
libusb_init'
My makefile is as followed:
CC = g++ CFLAGS = -Wall -g
all: simple
simple: simple.o ${CC} ${CFLAGS} simple.o -lusb-1.0 -lcflie -o simple
simple.o: simple.cpp CCrazyflie.h ${CC} ${CFLAGS} -c simple.cpp
clean: rm simple.o simple
To point something out I have moved libcflie.a file to /usr/local/lib. Can someone give a had solving this issue??
When you try to compile the CMake project that comes with the library, what happens? It is linking against libusb-1.0 here. If this works, something might be off with your Makefile.
Things you could try:
- Compile the CMake project, look for this message:
The USB libs appear to not be installed.
- Change the linking order in your Makefile from
-lusb-1.0 -lcflie
to-lcflie -lusb-1.0
- Change the compiler from
g++
togcc
(this is a rather desperate measure)
Cheers
The issue was on my Makefile. Changing the linking order solved the issue.
Thanks for the help. Just to let you know I'm using your library to make a Matlab Simulink library.
Great to hear, both of it! When you got the library running, I'd love to have a look!
This is spam and steal my personal information.. don't trust this. Because someone who stolen my clip from my compute I have to stop this from use my ID for fraud. Pls be careful with fake profit honest I never sign up GitHub member so far til I found out something appear on my VPN show me lists of hackers that's why I am here to tell this one which belong to me I will ask for cancel this when you get it from this. I suggest you all pls don't steal people a cell and Amy devices FBI will look thought google map and more app. I am waive because they found out already. They send me lists of hack who accessing my device. I block all of them. It real pain my ass. Evil people who is cleverly to use people a account transfer.. they will find you asap