Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on a Mac #5

Open
mcoughlin opened this issue Apr 29, 2015 · 1 comment
Open

Compiling on a Mac #5

mcoughlin opened this issue Apr 29, 2015 · 1 comment

Comments

@mcoughlin
Copy link

I am attempting to compile the shared library on a Mac (I have successfully compiled on SL7 and it works great!). To do so, I added the framework flags below to the $(CC) line:

libfli.so: libfli.o $(ALLOBJ)
$(CC) -shared -o $@ $^ -framework Foundation -framework IOKit

I am still running into an error of:

gcc -shared -o libfli.so libfli.o libfli-sys.o libfli-debug.o libfli-mem.o libfli-usb.o libfli-usb-sys.o libfli-serial.o libfli-camera.o libfli-camera-parport.o libfli-camera-usb.o libfli-filter-focuser.o -framework Foundation -framework IOKit
Undefined symbols for architecture x86_64:
"_linux_bulktransfer", referenced from:
_FLIUsbBulkIO in libfli.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libfli.so] Error 1

Any thoughts?

@StuartLittlefair
Copy link

This is a bug in the FLI SDK I think.

You want to replace the following in libfli.c

#ifdef _WIN32
long usb_bulktransfer(flidev_t dev, int ep, void *buf, long *len);
#else
long linux_bulktransfer(flidev_t dev, int ep, void *buf, long *len);
#define usb_bulktransfer linux_bulktransfer
#endif

with

#ifdef _WIN32
long usb_bulktransfer(flidev_t dev, int ep, void *buf, long *len);
#elif defined(__APPLE__)
long mac_bulktransfer(flidev_t dev, int ep, void *buf, long *len);
#define usb_bulktransfer mac_bulktransfer
#else
long linux_bulktransfer(flidev_t dev, int ep, void *buf, long *len);
#define usb_bulktransfer linux_bulktransfer
#endif

This is not the end of your concerns. Having fixed the above I am now having issues with duplicate symbols which I am yet to resolve

duplicate symbol _mac_fli_lock in:
    libfli-sys.o
    libfli-usb-sys.o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants