I been receiving the error: Warning: Creating a DLL with no exports. No import libraries will be created while trying to make a simple Dll. I have read
http://forums.ni.com/ni/board/message?board.id=180&thread.id=11389 and looked at code which works. However, I cannot create a library. The code consist of two files: BertTeststandPassing.c and BertTeststandPassing.h.
BertTeststandPassing.c
#define DLL_Export __declspec(dllexport)
#include <ansi_c.h>
#include <utility.h>
#include "BertTeststandPassing.h"
#ifdef _CVI_DLL_
int __stdcall DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
if (InitCVIRTE (hinstDLL, 0, 0) == 0)
return 0; /* out of memory */
break;
case DLL_PROCESS_DETACH:
CloseCVIRTE ();
break;
case DLL_THREAD_DETACH:
break;
}
return 1;
}
// end DllMain
int __stdcall DllEntryPoint (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
/* Included for compatibility with Borland */
return DllMain (hinstDLL, fdwReason, lpvReserved);
}
#endif
int DLL_Export test( ){
return 0;
}
BertTeststandPassing.h
/************** Static Function Declarations **************/
#define DLL_Export __declspec(dllexport)
typedef struct
{
int frame_number;
int word_number;
int expected_data;
int actual_data;
} Bit_Error_Record;
/************** Global Variable Declarations **************/
/************** Global Function Declarations **************/
extern int __stdcall DllMain(HINSTANCE hinstDLL,
DWORD fdwReason, LPVOID lpvReserved);
extern int __stdcall DllEntryPoint(HINSTANCE hinstDLL,
DWORD fdwReason, LPVOID lpvReserved);
extern int __decspec(dllexport) __cdecl test(void);
My company typically uses __export __cdecl instead of __decspec(dllexport).
Thanks a head of time. 🙂
~kat