- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm Working from Windows 11 and try to set up the Fortran Compiler. I want to use it together with MSC Marc, a Finite Element Code, however I struggle to get everything run in the first place.
I installed Visual Studio 2022 und Build Tools 2022 with the C++ Desktop Development Tools. Then I installed the oneapi Base Kit 2024.2 and afterwards the HPC Kit 2024.2 where I installed the ifort compiler.
Now say I open the oneAPI promt and want to compile a simple "Hello World" Test.f90 program. This is what it gives me:
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.13.0 Build 20240602_000000
Microsoft (R) Incremental Linker Version 14.44.35221.0
C:\Program Files (x86)\Intel\oneAPI\2024.2\bin\ifort.exe
-out:Test.exe
-subsystem:console
Test.obj
LINK : fatal error LNK1181: Eingabedatei "C:\Program.obj" kann nicht geöffnet werden.When I promt "link /" it gives
Microsoft (R) Incremental Linker Version 14.44.35221.0
C:\Program Files (x86)\Intel\oneAPI\2024.2\bin\ifort.exe
LINK : fatal error LNK1117: Syntaxfehler in Option "".What is my problem with the linker and how can I fix it?
Many thanks in advance
Nils Lange
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found my error. I had a system environment variable "LINK" and when I deleted it, now it compiles without error.
Thanks for the help anyway!! I must say though that getting ifort to run on Windows is quite tricky, was much simpler on Linux, but I have no choise which system to use here...
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The linker is trying to open the object file "Program.obj" instead of "Test.obj" => the problem is probably due to blanks in the file path that are not correctly interpreted => define your file path using double quotes
Have you tried building the project directly from Visual Studio? VS takes care of the file path for you...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the quick reply, but that cannot be it. My path does not contain any blanks. I also tried to build a program out of Visual Studio in different locations and it is always the same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You did not show the command so I do not know what you did.
I have later Oneapi installed so for ifort I made a cmd window and ran:
"C:\Program Files (x86)\Intel\oneAPI\2024.2\oneapi-vars.bat"
Then:
C:\tmp>ifort hello.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.13.0 Build 20240602_000000
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.
ifort: remark #10448: Intel(R) Fortran Compiler Classic (ifort) is now deprecated and will be discontinued late 2024. Intel recommends that customers transition now to using the LLVM-based Intel(R) Fortran Compiler (ifx) for continued Windows* and Linux* support, new language support, new language features, and optimizations. Use '/Qdiag-disable:10448' to disable this message.
Microsoft (R) Incremental Linker Version 14.44.35214.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:hello.exe
-subsystem:console
hello.obj
C:\tmp>type hello.f90
Program Hello
write(*,*) ' Hello world'
end program hello
C:\tmp>
I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply, yes that is exaxtly what I did
ifort Test.f90Basically I did all the step you did and it creates Test.obj with no issue and then comes
LINK : fatal error LNK1181: Eingabedatei "C:\Program.obj" kann nicht geöffnet werden
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found my error. I had a system environment variable "LINK" and when I deleted it, now it compiles without error.
Thanks for the help anyway!! I must say though that getting ifort to run on Windows is quite tricky, was much simpler on Linux, but I have no choise which system to use here...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page