11-19-2013 07:15 AM
This short piece of code below causes compiler crash in CVI 2010 - in CVI9.0 it works fine.
Thanks for help.
jirjan
/* Compiler Crash example, CVI 2010 - v10.0.0 */
static void fctDummy1(void) {};
static void fctDummy2(void) {};
typedef struct tagMyStruct
{
void (*DummyFunction1) ( void );
void (*DummyFunction2) ( void );
} tMyStruct;
tMyStruct MyFctStruct = {fctDummy1, fctDummy2};
const tMyStruct MyConstFctStruct = {fctDummy1, fctDummy2};
void MyTest(void)
{
MyFctStruct.DummyFunction1();
MyFctStruct.DummyFunction2();
/* this line doesn't cause the compiler crash...!!*/
MyConstFctStruct.DummyFunction1();
/* BUT next line caused the compiler crash...!!*/
MyConstFctStruct.DummyFunction2();
}
11-20-2013 06:57 AM
Hi Jirjan,
what do you mean with "compiler crash", can you give me an explanation of the error?
Have you tried to compile your code on another computer with CVI2010?
Best regards
Dominik
11-20-2013 07:37 AM
Hi Dominik,
1. Compiler crash - I mean CVI 2010 exits while compiling (without any message) and must be started again.. It took me some time to find what caused this - I have a large project and using this const struct in many modules. CVI9.0 works fine and as well previous versions - I am using CVI from version 5 for many years and always I was satisfied..Unfortunately the company doesn't want to spend money for CVI 2013 :-(..
2. I have no other computer in company with CVI 2010 installed.. I have Windows XP and both CVI 9.0 and CVI 2010 is installed on my computer..
Thanks and nice day
Jiri
11-21-2013 09:46 AM
Hey Jiri,
can you upload a project for me, so i can compile it on CVI2010
best regards
Dominik
11-21-2013 10:18 AM
It is a very simple project with one source file only - sending in attachment (adapt to your project path or create simple project with .c file)..As I wrote before - with CVI9.0 (and/or any C compiler) I can compile the source file, CVI 2010 crashes while compiling..
Thanks for your time
Jiri
11-22-2013 04:54 AM
Hey Jiri,
now i tested your project in CVI2009, CVI2010 an CVI2013.
In 2013 i have no problem to compile your project.
In CVI2010 i have an pop up after i click "compile file", the message is "A custom control callback raised an exception".
But when i click "ok", my CVI is working but nothing happens, do you know what the exception is?
When i outlining the last line, the compiler runs.
Best regards
Dominik
11-22-2013 05:12 AM
Hi Dominik,
thanks for testing! On the contrary I don't see any error while compiling and system (CVI) immediately goes down.. Yes, just the last line caused it - I did many experiments to find any relation...
I removed const in all such structures in my project and it seems it works - anyway I am convinced now that is the serious problem on NI side in CVI2010 compiler...
Glad to hear it is working in CVI2013 - I try to persuade bosses to buy it.. Although I use CVI in a special way (developing C software for various hw platforms) and don't use the main features, I consider it as perfect system...
Nice day
Jiri
11-27-2013 02:39 AM
Hi Jiri,
maybe you can use an external compiler
http://zone.ni.com/reference/en-XX/help/370051T-01/cvi/programmerref/buildingprjinextcompiler/
Best regards
Dominik