Newbee question lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- medamarko · 2011-10-31 10:37 Hi All, I'm trying to port demo app for libusb written in fpc on OSX. I installed libusb and libusb dev packages using macport. I also changed: {$LINKLIB /usr/lib/libusb-1.0.a} to {$LINKLIB libusb-1.0} (i assume that it will use libusb-1.0dylib). But when i try to recompile project i get following errors: Code: [Select]Undefined symbols:   "_libusb_exit", referenced from: _UMIKROUSB_CLOSELIBUSB in umikrousb.o   "_libusb_init", referenced from: _UMIKROUSB_OPENLIBUSB in umikrousb.o ld: symbol(s) not found Error: Error while linking Probably I oversee something: And here are prototypes of functions: Code: [Select]{$LINKLIB libusb-1.0} function libusb_init(ctx:PPlibusb_context):longint;cdecl;external; procedure libusb_exit(ctx:Plibusb_context);cdecl;external;  This is the same units and project that works fine on Linux. Thanks in advance. Marko ---------------------------------------------------------------------- Jonas Maebe · 2011-10-31 10:48 You can try executing something like "pkg-config --libs usb" (or maybe "pkg-config --libs libusb") to check whether you also have to link other libraries. ---------------------------------------------------------------------- medamarko · 2011-10-31 11:19 I get this output: Code: [Select]svps-Mac:~ svp$ pkg-config --libs libusb Package libusb was not found in the pkg-config search path. Perhaps you should add the directory containing `libusb.pc' to the PKG_CONFIG_PATH environment variable Does this mean that libusb is not properly installed..? Any hints? Thanks. ---------------------------------------------------------------------- Jonas Maebe · 2011-10-31 19:10 Google suggests trying "pkg-config --libs libusb-1.0" (when searching for pkg-config libusb). ---------------------------------------------------------------------- medamarko · 2011-11-01 11:01 Thanks, Yes you are right. I've got this output: Code: [Select]-L/opt/local/lib -lusb-1.0 It seems like Lazarus cannot link library. Because I'm getting the same errors when i remove {$LINKLIB libusb-1.0}. I added in search path: /usr/local/lib and also tried with /opt/local/lib but without luck. I'm beginner in OSX and im not sure that i correctly configured compiler to find libusb library... Regards