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

Build examples for Linux with Makefile or CMake #3

Open
janrinze opened this issue Jul 17, 2023 · 0 comments
Open

Build examples for Linux with Makefile or CMake #3

janrinze opened this issue Jul 17, 2023 · 0 comments

Comments

@janrinze
Copy link

janrinze commented Jul 17, 2023

Hi there,

After days of fiddling with the SDK i finally managed to get images from the Thorlabs zelux CS165MU under Win11.
Unfortunately the example code only gives a pointer to the image but not how the data is organized. (RGB? width? height? etc.)

The Linux version of the SDK however won't get far and will cause a segfault. Apart from the curiously creative dlopen solution (why not just link the executable with the libraries??) it looks pretty straight forward C code.

In general linking with shared libraries is as simple as adding -l<library> to gcc. Using dlopen however will add an enormous amount of complexity (see the ..._load.c source files) that mimics the same behavior but skips the initialization of the library. It also hides any other issues that may arise by simply using pointers that may or may not be correctly configured. Dynamic linking actually makes the code simpler and possibly faster. Let the compiler do the heavy lifting, it's built for that.

Under Linux it is general practice to have some sort of build environment that is widely supported like Make or CMake.
The latter allowing for easy checks of where to find related libraries and such.

I hope to see some Linux examples in this repository that can be used to reproduce a working camera image capture.

best regards,
Jan Rinze.

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

1 participant