GCC compilation error

Discussion in 'C++' started by eeh, May 7, 2005.

  1. eeh

    eeh Guest

    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'
    :
    :
    eeh, May 7, 2005
    #1
    1. Advertising

  2. eeh

    Rolf Magnus Guest

    eeh wrote:

    > 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?
    Rolf Magnus, May 7, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paolini
    Replies:
    4
    Views:
    669
    Alf P. Steinbach
    Oct 8, 2003
  2. Replies:
    8
    Views:
    428
  3. Kevin P. Fleming

    C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1

    Kevin P. Fleming, Nov 6, 2003, in forum: C Programming
    Replies:
    2
    Views:
    644
    Kevin P. Fleming
    Nov 6, 2003
  4. Replies:
    4
    Views:
    323
  5. C__chp
    Replies:
    4
    Views:
    503
    Puppet_Sock
    Feb 15, 2008
Loading...

Share This Page