Skip to content

Shortcut for addition of DYLIB_API before functions and variables #11

Discussion options

You must be logged in to vote

Hello,
The goal of DYLIB_API is to mark a function or a variable as extern "C" and put dllexport on windows.

https://www.mathworks.com/help/compiler_sdk/gs/create-a-c-application-with-matlab-code.html

In Matlab, if you build your code as a C dynamic library, the usage of extern "C" is now useless
On the link above, I saw that you have the option "exported function", this option will add dllexport before your exported function

With that, you should no longer need to add manually DYLIB_API.
After building into a C dynamic library, you can check if your symbols are here and correctly named using nm:
https://en.wikipedia.org/wiki/Nm_(Unix)

Replies: 1 comment 26 replies

Comment options

You must be logged in to vote
26 replies
@martin-olivier
Comment options

@sethupavan12
Comment options

@martin-olivier
Comment options

@sethupavan12
Comment options

@sethupavan12
Comment options

Answer selected by sethupavan12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants