Link problem with libusb

Muz zviman at comcast.net
Sun Mar 7 13:29:26 PST 2010


I'm trying to use libusb. I'm using QtCreator IDE. I get the message:
ld: warning: in /opt/local/lib/libusb-1.0.dylib, file is not of required
architecture

here is the .pro:

TARGET = TestLibUSB
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h\
            /opt/local/include/libusb-1.0/libusb.h

FORMS    += mainwindow.ui

LIBS    += /opt/local/lib/libusb-1.0.dylib

and the compile output:

Running build steps for project TestLibUSB...
Configuration unchanged, skipping QMake step.
Starting: /usr/bin/make -w 
make: Entering directory `/Users/muz/ProgrammingProjects/TestLibUSB'
/usr/bin/qmake -spec /usr/local/Qt4.6/mkspecs/macx-g++ -macx -o Makefile
TestLibUSB.pro
make: Leaving directory `/Users/muz/ProgrammingProjects/TestLibUSB'
make: Entering directory `/Users/muz/ProgrammingProjects/TestLibUSB'
g++ -headerpad_max_install_names -arch i386 -o
TestLibUSB.app/Contents/MacOS/TestLibUSB main.o mainwindow.o
moc_mainwindow.o -F/Library/Frameworks -L/Library/Frameworks
/opt/local/lib/libusb-1.0.dylib -framework QtGui -framework QtCore
ld: warning: in /opt/local/lib/libusb-1.0.dylib, file is not of required
architecture
Undefined symbols:
"_libusb_get_device_descriptor", referenced from:
MainWindow::print_devs(libusb_device**, QStringList&) in mainwindow.o
"_libusb_init", referenced from:
MainWindow::MainWindow(QWidget*)in mainwindow.o
MainWindow::MainWindow(QWidget*)in mainwindow.o
"_libusb_get_device_address", referenced from:
MainWindow::print_devs(libusb_device**, QStringList&) in mainwindow.o
"_libusb_free_device_list", referenced from:
MainWindow::~MainWindow()in mainwindow.o
MainWindow::~MainWindow()in mainwindow.o
MainWindow::~MainWindow()in mainwindow.o
"_libusb_get_bus_number", referenced from:
MainWindow::print_devs(libusb_device**, QStringList&) in mainwindow.o
"_libusb_exit", referenced from:
MainWindow::~MainWindow()in mainwindow.o
MainWindow::~MainWindow()in mainwindow.o
MainWindow::~MainWindow()in mainwindow.o
"_libusb_get_device_list", referenced from:
MainWindow::MainWindow(QWidget*)in mainwindow.o
MainWindow::MainWindow(QWidget*)in mainwindow.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [TestLibUSB.app/Contents/MacOS/TestLibUSB] Error 1
make: Leaving directory `/Users/muz/ProgrammingProjects/TestLibUSB'
Exited with code 2.
Error while building project TestLibUSB
When executing build step 'Make'

Do I have to recompile from source? if so, how do I do it?

Thanks,
Muz
-- 
View this message in context: http://old.nabble.com/Link-problem-with-libusb-tp27812402p27812402.html
Sent from the MacPorts - Users mailing list archive at Nabble.com.



More information about the macports-users mailing list