error LNK2019: unresolved external symbol _MAIN__ referenced in function _main libifcoremt.lib
-
Friday, July 20, 2007 4:48 PM
Hi,
I am very new to using Visual Studio. I'm developing a project for my internship that uses a VC++ GUI to call a FORTRAN program. I'm right now using just a simple FORTRAN program and trying to connect to it to the C++ code developed with my GUI. I've been learning bits and pieces of VC++ all summer, but cannot get over this errors:
error LNK2019: unresolved external symbol _MAIN__ referenced in function _main libifcoremt.lib
fatal error LNK1120: 1 unresolved externals ..\Project100\Console4.exe
fatal error LNK1104: cannot open file 'Console4.lib' Project100I think the second and third errors are related to the first error, and solving that will solve the rest.
I'm using Visual Studio 2005, and Intel FORTRAN compiler. Any help would be greatly appreciated!!
In my C++ code, I define the FORTRAN by:
#ifdef
__cplusplusextern
"C"{
void CONSOLE1(int *TSTART, int *answer);}
#endif
and call it as:
CONSOLE1(&TSTART, &answer);
My FORTRAN is a simple file that looks like this:
SUBROUTINE
CONSOLE1(N, M) IMPLICIT NONE
INTEGER N INTEGER MM = N*N
RETURN ENDMAIN and main do not exist anywhere in my work, which is why the error confuses me. And I've added to my additional directories Console4.lib, the library file to the FORTRAN program (I think). Thanks in advance for any help!!
All Replies
-
Friday, July 20, 2007 11:33 PMModerator
-
Monday, July 23, 2007 5:10 PM
Hello,
Thanks for the advice, but I looked through that thread and tried many of the things that it mentions in there. the main issue seemed to be that all runtime libraries needed to be the same. Mine are all the same, set to Multithreaded Debug. I'm not even sure which option to choose, and how each is different. If you have any other advice, I'd greatly appreciate it!! :-)

