Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29233 Discussions

Problem with compiling - unresolved external symbol _mainCRTStartup

Zahra_A_
Beginner
2,689 Views

 

 I have a problem with compiling fortran programs in visual studio. I have used visual studio 2010 and 2008 and Intel Visual Fortran Composer 13 and 15. When I debug the ".for" programs, I face these errors:

 Error    1    error LNK2001: unresolved external symbol _mainCRTStartup    

 Error    2    error LNK1120: 1 unresolved externals    

I have done what you wrote on this page but I still face the same errors. I should say that I can compile and run the ".f90" program without any problems, and these errors are just for ".for" program.

Please help me to solve this problem.

0 Kudos
5 Replies
Arjen_Markus
Honored Contributor II
2,689 Views

You will have to provide more details for us to diagnose the problem (there is more than one .f90 or .for program :)). One way is to show a small version of the program that reproduces the problem.

My guess is that you have the wrong kind of project for the program or that you have not included a main program (in Fortran: the PROGRAM subprogramt). But that is just a guess. We probably need more information, but with that we can make a start.

0 Kudos
Zahra_A_
Beginner
2,689 Views

Thanks for your answer. 

I should say that when I want to run programs which are written in “compaq visual fortran”, in visual studio, I am faced with these errors. I have used visual studio and intel visual fortran composer to run fortran programs in windows 8.1. I do not have any experience in writing and running fortran programs with visual studio.

I have attached a simple program which is written in compaq visual fortran and then when I want to run in visual studio, these errors come up.

 

0 Kudos
reidar
New User
2,689 Views

I downloaded the zip file, and I have run the program. It is a console application, and as it is defined, a C++ project, not a fortran project, the you would have a sln project file. I opened it, (the dws file) with VS2013, upgraded to Visual Fortran and then from the menu Project ->Extracted Compaq Visual Fortran Prjects Items..

So ensure when creating a project, it must

 

0 Kudos
reidar
New User
2,689 Views

be a Fortran project..

0 Kudos
Zahra_A_
Beginner
2,689 Views

Thanks for the answer.

Project ->Extracted Compaq Visual Fortran Prjects Items was the solution. Now I can run all of my previous programs in visual studio.

Thank you so much.

0 Kudos
Reply