08-20-2013 09:23 AM
Another issue...
#include <utility.h> extern DLLEXPORT int crashme; int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { if (InitCVIRTE (hInstance, 0, 0) == 0) return -1; /* out of memory */ crashme = 1; return 0; }
This makes clang.exe crash (using Windows 8, maybe it matters).
08-22-2013 03:32 AM
Hello!
Thanks for reporting the issue. I have filed bug report # 423475 for the problem.
However, it appears to me that you're trying to import "crashme" from a DLL into your project. Did you mean to use DLLIMPORT instead of DLLEXPORT? DLLEXPORT suggests that you're trying to export crashme from the current project and it's a little unusual to reexport a variable that you've just imported with "extern". (Unusual but no excuse for clang crashing.)
Sorry, the import/export directives are a big confusing. I'll try to summarize:
extern int x;
Variable x is declared externally and you're importing it from some other file into this file.
DLLIMPORT int x;
Variable x is declared externally in a DLL and you're importing it into this file.
DLLEXPORT int x;
Variable x is declared in this file (which is part of a DLL) and you're exporting x from the DLL for use in other DLLs/EXEs.
Thanks,
Peter
08-22-2013 04:57 AM - edited 08-22-2013 04:57 AM
Hello Peter,
Thanks for your explanation.
Older CVIs accept "extern DLLEXPORT", Clang now complains. Well, some issues in the code surface now.
09-11-2013 08:33 AM
I thought of another work-around to the problem. Move DLLEXPORT to the definition of the variable, that is, change
extern DLLEXPORT int crashme;
to
extern int crashme;
and add the DLLEXPORT to wherever 'crashme' is defined:
DLLEXPORT int crashme; // in another file