# Visual Studio: The Fortran compiler is not able to compile a simple test program.

**URL:** https://discourse.cmake.org/t/visual-studio-the-fortran-compiler-is-not-able-to-compile-a-simple-test-program/5091
**Category:** Usage
**Tags:** os:windows
**Created:** [February 23, 2022, 3:41am UTC](https://discourse.cmake.org/t/visual-studio-the-fortran-compiler-is-not-able-to-compile-a-simple-test-program/5091 "2022-02-23T03:41:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![FFFFFG-IGG](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fffffg-igg/32/2209_2.png) [@FFFFFG-IGG](https://discourse.cmake.org/u/FFFFFG-IGG)
#### Post date: [February 23, 2022, 3:41am UTC](https://discourse.cmake.org/t/visual-studio-the-fortran-compiler-is-not-able-to-compile-a-simple-test-program/5091/1 "2022-02-23T03:41:00Z")

</div>

I‘m a visual studio user under win11. Now I’d like compile the source code downloaded from github and further generate the vs 2022 project with Cmake 3.23.0-rc1(gui). But I met some mistakes and could not find the way out.  
Ps:  
**Cmakelist.txt** \*\*\*\*\*\*\*\*\*\*\*  
cmake\_minimum\_required(VERSION 3.7)  
project(GROOPS LANGUAGES CXX Fortran)

set(CMAKE\_CXX\_STANDARD 14)  
set(CMAKE\_Fortran\_FLAGS “-std=legacy”)  
include\_directories(${PROJECT\_SOURCE\_DIR})  
include(sourcesCXX.txt)  
include(sourcesF77.txt)  
include(sourcesF90.txt)  
add\_library(groopscore OBJECT ${SOURCES})

* * *

Error:

 ![image](https://discourse.cmake.org/uploads/default/original/2X/f/fd5843784327ab82faa9a52bc8f262e82a2427e4.png)

Actually I know little about Cmake, could some tell me what should I do to solve it?(I’d like to generate a vs project)  
Many thanks!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 23, 2022, 3:33pm UTC](https://discourse.cmake.org/t/visual-studio-the-fortran-compiler-is-not-able-to-compile-a-simple-test-program/5091/2 "2022-02-23T15:33:59Z")

</div>

I don’t think Visual Studio supports Fortran in any way other than through the Intel compiler. You’ll need to use `Ninja` or a `Makefiles` generator to use `gfortran` on Windows.

Cc: @brad.king
