@darnell,
You must prefix each declaration of the functions you want to export, with "DLLEXPORT _VI_FUNC". In this case your dll target setting for exports should be set to "symbols marked for export". Only these functions will be exported.
If you want to export all the files in an include file, your dll target settings for exports should be set to "include file symbols" than choose the desired include file.
Only than your lib file will be also created.
Regards.
#define DLLEXPORT __declspec(dllexport)
(this is defined in <cvidef.h>, which should be automatically included...)
on the other hand, _VI_FUNC is nowhere to be found. but i would suggest using DLLSTDCALL (which i bet resolves to the same function decorator):
#define DLLSTDCALL __stdcall
(this is also defined in <cvidef.h>)
use those when declaring the functions you want to export:
int DLLEXPORT DLLSTDCALL sample_function(void);
@darnell,
Assume, that inside a dll, we have following functions:
void myFunc1 (int i);
void myFunc2(int i);
If want to export function just myFunc1, you have to change its declaration as follows:
void DLLEXPORT _VI_FUNC myFunc1 (int i);
If Exports is set to: Symbols marked for export, than only myFunc1 will be exported. "DLLEXPORT" is defined in cvidef.h and "_VI_FUNC" is defined in visatype.h
Regards
okay its coming together , i started over from scratch and tried a basic program, I have two functions that i call, only function is working.
my PRINT(); is not working, meaning its not print out my string;
check the cvi pro out . to see what im talking about.
you need the DLLEXPORT to compile the DLL, in order to tell the compiler you want to export the function.
once it is in the dll, the function declaration does not need the DLLEXPORT anymore, so remove it from your CVI code. in the program which is using the dll, you don't need to export anything, you need to import the function.