- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
be a Fortran project..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page