fairlight1337 / libcflie

Crazyflie Nano C++ Client Library
http://fairlight1337.github.io/libcflie.html
48 stars 68 forks source link

Compiling against using makefile #11

Open rshum19 opened 9 years ago

rshum19 commented 9 years ago

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 tolibusb_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??

fairlight1337 commented 9 years ago

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:

Cheers

rshum19 commented 9 years ago

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.

fairlight1337 commented 9 years ago

Great to hear, both of it! When you got the library running, I'd love to have a look!

Silenceman65 commented 2 years ago

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