08-26-2015 01:46 AM
Hello again,
The code generated with CVI 2015 has these errors and warnings (all warnings enabled) if you have a header where the functions are decorated with DLLEXPORT or DLLIMPORT like "DLLEXPORT void __stdcall Func(void);"
error: expected ';' after top level declarator
warning: declaration does not declare anything [-Wmissing-declarations]
(both are caused by the "__declspec(dllexport);" after the Ptr definition.
warning: assigning to 'void (*)()' from 'void *' converts between void pointer and function pointer [-Wtypecheck-convert]
(which is the "...Ptr = (void*) GetProcAddress...")
warning: function declaration isn't a prototype. [-Wstrict-prototypes]
error: expected ';' after top level declarator
error: expected identifier or '('
(the function definition "void Func() __declspec(dllexport)")
warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
note: place parentheses around the assignment to silence this warning
note: use '==' to turn this assignment into an equality comparison
("if (dllLoadError = LoadDLLIfNeeded())")
08-23-2016 11:31 PM
I'm getting this error [error: expected ';' after top level declarator ] and I have got no clue at all.
You explained that "both are caused by the "__declspec(dllexport);" after the Ptr definition".
What do you mean by "after the Ptr definition" ? What is this Ptr ?
08-25-2016 03:03 AM
If you export a function like void __stdcall Func(void) then the tool creates a .c file with function pointers like void (__stdcall *Func_Ptr)(). I abbreviated this with "...Ptr".
To solve your error: just delete the " __declspec(dllexport)" or " __declspec(dllimport)", that's not supposed to be there and thus causes the error.