08-22-2019 04:40 PM
I am new to LanWindows and working on a Legacy application, which has many projects defined as Dynamic Link Library using 2010 LabWindows .
I created a new Dynamic Link Project, say my_DLL_prj. Added into the workspace. In Target Type, set a header file mytest.h in DLL Export Options dialogue. then I build this my_DLL_prj. LabWindows reported my_DLL_prj.dll and my_DLL_prj.lib are created correctly.
In main application, added the mytest.h file to main project, added the my_DLL_prj.lib into the main project. then in main.c file, I call a function, my_test() defined in mytest.h file from my_DLL_prj.
It complains link errors - Undefined symbol '_my_test' reference in 'main.c'.
Since it is an legacy project from many years ago, I am trying to look through existing projects hopefully can find some clue. All existing DLL project will create a file named exports in the cvibuild.projectX folder. and inside this file, there is a symbol of function names that are exported.
[ShowSWFP_X]
callConv = 115
name = ShowSWFP_X
paramSize = 20
But, my_DLL_prj does not generate a exports file.
I had read the NI LabWindows/CVI help for roughly one week already... did not find a clue.
Many thanks.
Solved! Go to Solution.
08-23-2019 03:19 AM
Other than the help you can get infos using the provided sample projects.
The "Find Examples..." item is on the lower left of the Welcome Page and in the Help menu.
Search for "DLLs" there to get a list of suitable projects.
Just make absolutely sure that your exported function and the prototype(s) match and (best practice) have an explicit calling convention decorator like CVICALLBACK, WINAPI, __cdecl or __stdcall.
08-26-2019 01:08 PM - edited 08-26-2019 01:09 PM
Hello CVI-User,