GCC compilation error

E

eeh

I tried to compile my test.c file in Cygwin by GCC.

My makefile is listed:

USBCFG = /home/a/libusb-config

all: test
..c.o:
cc -O -Wall `$(USBCFG) --cflags` -c $<

test: test.o
cc -o test test.o `$(USBCFG) --libs libusb.a`

clean:
rm *.o
rm test

But the following compilation errors appear. It seems that the library
file cannot be linked. Anyone knows what happens? I have put the
libusb.a library file under the same directory with the test.c file.

...... undefined reference to '_usb_init'
...... undefined reference to '_usb_find_busses'
:
:
 
R

Rolf Magnus

eeh said:
I tried to compile my test.c file in Cygwin by GCC.

Your question is off-topic here, since it's not about standard C++.
cc -o test test.o `$(USBCFG) --libs libusb.a`

If you write it that way, "libusb.a" will be given as command line argument
to libusb-config. Is that what you wanted?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top