forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Possible name mangling problem using FTN95 with VS 2017
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
dbradly



Joined: 20 Nov 2006
Posts: 31

PostPosted: Mon Jan 06, 2020 11:57 am    Post subject: Possible name mangling problem using FTN95 with VS 2017 Reply with quote

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.
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Mon Jan 06, 2020 1:04 pm    Post subject: Reply with quote

Is this a regular 32-bit (no .NET application)? Does it look like the DLL is passed through to slink?
Back to top
View user's profile Send private message Visit poster's website
dbradly



Joined: 20 Nov 2006
Posts: 31

PostPosted: Tue Jan 07, 2020 9:37 am    Post subject: Possible name mangling problem using FTN95 with VS 2017 Reply with quote

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 ClientC:\Program Files\Intel\iCLS ClientC:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0C:\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 Filesc:\ginodll
f:\bin
c\cygwin64\bin
C:\Program Files\Microsoft SQL Server\110\Tools\BinnC:\Program Files (x86)\Skype\PhoneI:\cmp\Salford\ftn95-810\FTN95
C:\Program Files\PuTTYI:\cmp\Salford\FTN95-840
i:\cmp\salford\ftn95-850

Project Directory: C:\Users\David\source\repos\FTN95 ginoex1\FTN95 ginoex1Output 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\Debu
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Tue Jan 07, 2020 10:30 am    Post subject: Reply with quote

What would your slink command line look like be when using interactive mode?
Back to top
View user's profile Send private message Visit poster's website
dbradly



Joined: 20 Nov 2006
Posts: 31

PostPosted: Tue Jan 07, 2020 1:38 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Wed Jan 08, 2020 5:26 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
dbradly



Joined: 20 Nov 2006
Posts: 31

PostPosted: Fri Jan 10, 2020 10:22 am    Post subject: Possible name mangling problem using FTN95 with VS 2017 Reply with quote

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?
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Fri Jan 10, 2020 2:09 pm    Post subject: Reply with quote

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

Well spotted!
Back to top
View user's profile Send private message Visit poster's website
dbradly



Joined: 20 Nov 2006
Posts: 31

PostPosted: Mon Jan 13, 2020 11:12 am    Post subject: Possible name mangling problem using FTN95 with VS 2017 Reply with quote

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
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Mon Jan 13, 2020 1:51 pm    Post subject: Reply with quote

The message is correct, they are not 64-bit DLLs. They are 32-bit .NET DLLs which can be safely removed from the project.
Back to top
View user's profile Send private message Visit poster's website
dbradly



Joined: 20 Nov 2006
Posts: 31

PostPosted: Mon Jan 13, 2020 3:28 pm    Post subject: Possible name mangling problem using FTN95 with VS 2017 Reply with quote

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?
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Mon Jan 13, 2020 3:30 pm    Post subject: Reply with quote

Select them in the solution and press the delete key
Back to top
View user's profile Send private message Visit poster's website
dbradly



Joined: 20 Nov 2006
Posts: 31

PostPosted: Tue Jan 21, 2020 12:41 pm    Post subject: Possible name mangling problem using FTN95 with VS 2017 Reply with quote

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?
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Sun Jan 26, 2020 6:35 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
dbradly



Joined: 20 Nov 2006
Posts: 31

PostPosted: Mon Feb 03, 2020 1:10 pm    Post subject: Possible name mangling problem using FTN95 with VS 2017 Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group