10-17-2009 06:19 PM
I( am trying to run the ANSI C compiler with the below source code and keep getting the following error. The Blodshed compiler returns no such error and runs as expected. Can anyone tell me what I am doing wrong in CVI? Thanks in advance.
runtime error
NON-FATAL RUN-TIME ERROR: "test_cvi_hello.c", line 9, col 5, thread id 0x00000200: Library function error (return value == -3 [0xfffffffd]).
link error
Multiply defined symbol '_main' in modules 'test_cvi_hello.c' and 'hello_source_2.c'.
#include <ansi_c.h>#include <stdio.h>int main(void){ printf("Hello World!\n") ; system("PAUSE"); return(0);}
Solved! Go to Solution.
10-18-2009 02:40 AM
Hi,
CVI organizes all files needed to create a program in projects, and when you compile the project all files included are compiled and linked (if no errors are found). Apparently you have a second source file (hello_source_2.c) listed in your project where another main () is found so the compiler cannot compile both files at the same time.
The project is normally shown on the left side of CVI workspace screen, organized in a tree where User Interface files, source files, include files and other components included in the project are listed: you must select the second source file in the project list and execute File >> Remove file menu option. After you have done it your code should compile without errors.
If you are new to CVI you could beneft reading some introductory manuals about the product: Getting Started with LabWindows/CVI is a very basic introduction to the product: here the link to the 8.5 version, you shoud have received a paper copy for your product or you shoud have it on CD/DVDs