-
Notifications
You must be signed in to change notification settings - Fork 318
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
Static build with Visual Studio #616
Comments
I've tried to do it and it work in my case: tanshihaj@3b9305e |
I think we can add an option to build libIIO as a static library. |
Just as a reminder - libiio is LGPL. From the GNU.org website emphasis in mine: (1) If you statically link against an LGPLed library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application. It's not hard/difficult - but you must comply with the obligations of the license. |
Set the LIBIIO_STATIC define when compiling a static library, which then causes the __api to be resolved as empty. This fixes building statically under MSVC. Fixes #616. Signed-off-by: Paul Cercueil <[email protected]>
Set the LIBIIO_STATIC define when compiling a static library, which then causes the __api to be resolved as empty. This fixes building statically under MSVC. Fixes #616. Signed-off-by: Paul Cercueil <[email protected]>
I'm wonder is it possible to build static version of libiio using Visual Studio compiler? Currently when I try to do it I get LNK2019 unresolved external symbol imp errors since here
libiio/iio.h
Lines 75 to 79 in 99ef201
__api
either as__declspec(dllexport)
or__declspec(dllimport)
, so linker, that links this library to my test program, thinks that this symbols should be defined in.dll
.Usually if you need to link static library
__api
should be defined as empty:https://github.com/substack/libssh/blob/c073979235eb0d0587ac9cb3c192e91e32d34b06/include/libssh/libssh.h#L26-L42
Is it possible to add some kind of
LIBIIO_STATIC
definition to make it possible to link libiio as static library?The text was updated successfully, but these errors were encountered: