Copy a compiler then edit the advanced compiler options.
This is what Command: Link Object files to static library shows for "PGI Fortran Compiler"
$lib_linker -r $static_output $link_objects
ranlib $exe_output
Tab: Other Settings Button: Advanced Options
Patch to enable verbose output; that should show the wrong path or missing path to Microsoft link.exe command. Tim S.
Edit: ranlib is just a dummy program for this compiler; so, it can removed.
From ba3dcbab18fdaf062452488ca4b5abfefb964833 Mon Sep 17 00:00:00 2001
From: Tim S <stahta01@gmail.com>
Date: Fri, 22 Feb 2019 17:29:19 -0500
Subject: compiler: Add verbose to PGI static link command. Thanks stahta01
---
.../compilergcc/resources/compilers/options_pgifortran.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/compilergcc/resources/compilers/options_pgifortran.xml b/src/plugins/compilergcc/resources/compilers/options_pgifortran.xml
index 6e428398b..5ad554875 100644
--- a/src/plugins/compilergcc/resources/compilers/options_pgifortran.xml
+++ b/src/plugins/compilergcc/resources/compilers/options_pgifortran.xml
@@ -202,7 +202,7 @@
<Command name="LinkDynamic"
value="$linker -shared $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs"/>
<Command name="LinkStatic"
- value="$lib_linker -r $static_output $link_objects&#xA;&#x9;ranlib $exe_output"/>
+ value="$lib_linker -vr $static_output $link_objects&#xA;&#x9;ranlib $exe_output"/>
<Command name="LinkNative"
value="$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs"/>
--
2.19.1.windows.1
Edit3: https://sourceforge.net/p/codeblocks/tickets/803/ (https://sourceforge.net/p/codeblocks/tickets/803/)
I figure out a better patch for the OP issue; this allows the OP fix/change to be easier. And, maintains the default way on Linux and Windows. Edit2: It adds the -v for verbose option to the static link command instead of advanced options on Windows.
Tim S.
From 8170d22e6ca089e67d25bb56a08ae1ad615e42e2 Mon Sep 17 00:00:00 2001
From: Tim S <tim.stahlhut@gmail.com>
Date: Tue, 26 Feb 2019 22:08:24 -0500
Subject: [PATCH] - compiler: In win32, move ar options to command (Thanks
stahta01)
And, removed ranlib command
---
.../resources/compilers/options_pgifortran.xml | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/plugins/compilergcc/resources/compilers/options_pgifortran.xml b/src/plugins/compilergcc/resources/compilers/options_pgifortran.xml
index 6e428398b..02a755fc2 100644
--- a/src/plugins/compilergcc/resources/compilers/options_pgifortran.xml
+++ b/src/plugins/compilergcc/resources/compilers/options_pgifortran.xml
@@ -5,7 +5,7 @@
<Program name="C" value="pgfortran.exe"/>
<Program name="CPP" value="pgfortran.exe"/>
<Program name="LD" value="pgfortran.exe"/>
- <Program name="LIB" value="ar.exe"/>
+ <Program name="LIB" value="ar.exe -vr"/>
<Program name="WINDRES" value=""/>
<Program name="MAKE" value="make.exe"/>
</if>
@@ -201,8 +201,14 @@
value="$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs"/>
<Command name="LinkDynamic"
value="$linker -shared $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs"/>
- <Command name="LinkStatic"
- value="$lib_linker -r $static_output $link_objects
	ranlib $exe_output"/>
+ <if platform="windows">
+ <Command name="LinkStatic"
+ value="$lib_linker $static_output $link_objects"/>
+ </if>
+ <else>
+ <Command name="LinkStatic"
+ value="$lib_linker -r $static_output $link_objects
	ranlib $exe_output"/>
+ </else>
<Command name="LinkNative"
value="$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs"/>
--
2.21.0.windows.1