Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

I am getting an linker error LNK2001 : unresolved symbol _main while compiling Microsoft c code

I am writng a simple application in C language for communicating with GPIB. when I compile the c file I am getting a linker error
LIBC.lib(ctr0.obj): LNK2001 error: unresolved sysmbol _main

I compile the application in the dos window using the command

cl gpibApplication.c gpib-32.obj.

Could anyone tell me how to remove this error
0 Kudos
Message 1 of 2
(3,332 Views)
Hello-

It sounds like the main function is missing from the gpibApplication.c file. Be sure that the following function is somewhere in the code:
int main (int argc, char *argv[])

Also, note that this function is case sensitive, so be sure main is not capitalized.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,332 Views)