Advertisement

.DEF exporting

Started by September 05, 2000 07:18 PM
0 comments, last by _Alex_ 24 years, 4 months ago
I''d like to keep myself from writing mangled function names to a def file manually so I wonder if there''s a tool to do that.
If you''re using MSVC you can do it right in the source file by using the __declspec compiler directive. To export a symbol (function or variable) stick __declspec (dllexport) in front of the declaration like so:

int __declspec (dllexport) MyFunc (int poo);

This will create a .lib file when linking. You can either dynamically link at runtime or statically link to the .dll at compile-time. That however is a different topic and I assume you know that.

btw, you can import symbols from a .dll by declaring them with __declspec (dllimport).

Borland might have similar constructs, but I do not know them.

Adieu.


I guess this is where most people put a famous quote...
"Everything is funnier with monkey''s" - Unknown
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown

This topic is closed to new replies.

Advertisement