Silverfrost Forums

Welcome to our forums

Possible name mangling problem using FTN95 with VS 2017

6 Jan 2020 10:57 #24826

Using our GINO libraries created as a dll, there is no problem linking these with an FTN95 object file using SLINK in interactive mode, but when trying to create a FTN95 project in Visual Studio 2017 the linker does not find any of the references (in a F90 module file) in the GINO library.

I have tried adding the GINO library as a composite dll or an import library, but get the same error.

Linker output: WARNING the following symbols are missing: GINO_F90!GENQCOLOURINFO etc. etc.

6 Jan 2020 12:04 #24827

Is this a regular 32-bit (no .NET application)? Does it look like the DLL is passed through to slink?

7 Jan 2020 8:37 #24829

Yes, it is a Win32 project. I was unsure whether to add the import library under the compiler/source option or as a linker option, but neither work. The build log follows:

/////////////////////////////////////

Build log for project: FTN95 ginoex1 Configuration: Debug/Win32 Date: 7/1/2020 - 08:08:33

/////////////////////////////////////

System Configuration ////////////////////

Path Directories: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\mpirt C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\mpirt C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\compiler C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\mpirt C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\mpirt C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler C:\Program Files (x86)\Intel\iCLS Client\C:\Program Files\Intel\iCLS Client\C:\Windows\system32 C:\Windows C:\Windows\System32\Wbem C:\Windows\System32\WindowsPowerShell\v1.0\C:\Program Files\Intel\Intel(R) Management Engine Components\DAL C:\Program Files\Intel\Intel(R) Management Engine Components\IPT C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT C:\Program Files\Acer\Remote Files\c:\ginodll f:\bin c\cygwin64\bin C:\Program Files\Microsoft SQL Server\110\Tools\Binn\C:\Program Files (x86)\Skype\Phone\I:\cmp\Salford\ftn95-810\FTN95 C:\Program Files\PuTTY\I:\cmp\Salford\FTN95-840 i:\cmp\salford\ftn95-850

Project Directory: C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Output Directory: C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32 Output File: Debug\Win32\FTN95 ginoex1.exe

Project Build /////////////

F:\ginof\gino90\examples\ginoex1.f90 Compiling file: ginoex1.f90 FTN95.EXE 'F:\ginof\gino90\examples\ginoex1.f90' /NO_BANNER /DEBUG /FULL_DEBUG /P6 /MOD_PATH f:\sal9590 /FPP/REF 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' /REF 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll' /REF 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.XML.dll' /VS8 /DELETE_OBJ_ON_ERROR /ERROR_NUMBERS /UNLIMITED_ERRORS /BINARY 'Debug\Win32\ginoex1.obj'

Linking...

Command line for link: slink.exe -implib f:\sal9590\ginlibs9.lib -OUT:'Debug\Win32\FTN95 ginoex1.exe' @'C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\link.lst' 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll' 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.XML.dll' Linker output: WARNING the following symbols are missing: GINO_F90!GSETLINEEND C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GDRAWLINEBY2D C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GDRAWARCTO2D C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSETCLIPPINGMODE C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSETCHARSIZE C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GMOVEBY2D C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GDEFINEPICTUREUNITS C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GENQCOLOURINFO C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GDEFINEBROKENLINESTYLE C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSETBROKENLINE C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GCLOSEGINO C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GMOVETO2D C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GDISPLAYSTR C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSETSOFTCHARS C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GENQDRAWINGLIMITS C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSUSPENDDEVICE C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSETCOLOURINFO C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSETLINECOLOUR C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GOPENGINO C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GMWIN C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSETLINEWIDTH C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GSETBROKENLINEMODE C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) MODULE GINO_F90 C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GDRAWARCBY2D C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GENQLINECOLOUR C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) GINO_F90!GDRAWLINETO2D C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1\Debug\Win32\ginoex1.obj (F:\GINOF\GINO90\EXAMPLES\GINOEX1.F90) Creating executable: Debug\Win32\FTN95 ginoex1.exe

FTN95 ginoex1 build succeeded.

/////////////////////////////////////

7 Jan 2020 9:30 #24830

What would your slink command line look like be when using interactive mode?

7 Jan 2020 12:38 #24831

We normally use a command file of the following form:

echo lo %1.obj>%1.lnk echo subsystem windows>>%1.lnk echo lo %GINO%\ginlibs9.dll>>%1.lnk echo file>>%1.lnk slink $%1.lnk

Here I link directly with the dll, but again I have tried this using Visual Studio, but get the same missing references.

8 Jan 2020 4:26 #24836

Can you send a sample project to ftn95@silverfrost.com? It might have to be a download link or the AntiVirus nasties might want to quarantine it.

10 Jan 2020 9:22 #24847

Robert, It lokks like coleague has found the cause of the problem:

  1. If I take the slink command that VS shows in the build.log file:

slink.exe 'C:\Program Files (X86)\gino\v9.0sal\GMWINERR.DLL' 'C:\Program Files (X86)\gino\v9.0sal\GINLIBS9.DLL' -OUT:'Debug\Win32\ginoex1.exe' @'C:\Users\kevin\source\repos\ginoex1\link.lst' 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll' 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.XML.dll'

and execute that in a command prompt, I get the same outstanding references. 2. We can remove the .NET dlls and that makes no difference 3. If I then move the @ statement to before the two DLLs it all works OK.

slink.exe @c:\users\kevin\source\repos\ginoex1\link.lst 'C:\Program Files (X86)\gino\v9.0sal\GMWINERR.DLL' 'C:\Program Files (X86)\gino\v9.0sal\GINLIBS9.DLL' -OUT:'Debug\Win32\ginoex1.exe' Creating executable: Debug\Win32\ginoex1.exe

So the only problem seems to be the ordering of the commands that Visual Studio puts together. I can’t see an obvious switch for that, so worth pointing that out in your Forum chat with Robert.

Do you have any comment?

10 Jan 2020 1:09 #24849

Interesting, almost like using the script resets the input to slink. I will take a look at it.

Well spotted!

13 Jan 2020 10:12 #24857

Robert,

A further problem with using Silverfrost FTN95 with Visual Studio is that if you change the project to x64, you get the following link error:

FTN95.EXE 'C:\Users\Public\Documents\gino\v9.0\examples\gino\ginoex1.for' /NO_BANNER /DEBUG /MOD_PATH 'C:\Program Files\gino\v9.0sal\modules' /FPP /64 /REF 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll' /REF 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll' /REF 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.XML.dll' /VS8 /DELETE_OBJ_ON_ERROR /ERROR_NUMBERS /UNLIMITED_ERRORS /BINARY 'Debug\x64\ginoex1.obj'

Linking...

Command line for link: slink64.exe 'C:\Users\kevin\source\repos\ginoex1\slink64.link' Linker output: [SLINK64 v2.10, Copyright (c) Silverfrost Ltd. 2015-2018] Loading C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll Loading C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll Loading C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.XML.dll Loading C:\Users\kevin\source\repos\ginoex1\Debug\x64\ginoex1.obj ***C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.XML.dll is not an x64 DLL file

13 Jan 2020 12:51 #24858

The message is correct, they are not 64-bit DLLs. They are 32-bit .NET DLLs which can be safely removed from the project.

13 Jan 2020 2:28 #24859

But the 32bit .NET libraries are automatically added to the project as part of the FTN95 plugin to Studio.

How does one remove them from the project?

13 Jan 2020 2:30 #24860

Select them in the solution and press the delete key

21 Jan 2020 11:41 #24912

Robert, Is there any progress on correcting the FTN95 integration with Visual Studio for 32 and 64bit win32 projects viv-a-vis the incorrect linking order and addition of .NET libraries when they are not needed?

26 Jan 2020 5:35 #24926

With regard to the incorrect linking order -- are you adding the DLLs as 'extra linking options' rather than as references? If they are added as references then they go after the response file in the command line. It looks like a slink bug that adding a .DLL before a response file causes it to be ignored.

The addition of the .NET 32-bit assemblies needs more thought.

3 Feb 2020 12:10 #24942

I'm not sure how to load a dll as an extra linker option. I have tried adding 'lo ginlibs9.dll' but the linker does not recognise 'lo'. I have tried adding just the dll name, but this does not work either - lots of missing references when linking.

The only solution we have found is to manually edit the .ftn95p file in the solution directory and add the references (in the same format as exiting ones) and then it does link and run!

As I have said adding the references through Studio crashes Studio, so the manual method seems to be the only way.

3 Feb 2020 12:14 #24943

You might like to look at this: http://forums.silverfrost.com/viewtopic.php?p=28357#28357

A potential fix for the add reference crash. It also allows DLL references to be assigned to Win32, .NET or x64 projects.

3 Feb 2020 12:35 #24944

Brilliant. That update to the FTN95 integration works fine. I can now add GINO dll's as references and get the project to link and run.

I have a separate problem which I will raise as a separate topic though.

Thanks.

Please login to reply.