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 

Multiply defined symbols for INTEL build using clearwin64.dl

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 224

PostPosted: Tue May 12, 2020 11:00 am    Post subject: Multiply defined symbols for INTEL build using clearwin64.dl Reply with quote

Hello,

I am building a GUI application using INTEL's 64 bit fortran compiler ifort, INTEL's linker xilink and SALFORD's Dll clearwin64.dll.

If I am using clearwin64.dll and clearwin64.lib of SALFORD ftn95 version 7.10 the building process works fine and creates the executable successfully.

However, if using clearwin64.dll and clearwin64.lib of SALFORD ftn95 version 8.61 (version info of clearwin64.dll in resource monitor: 22.2.3.15, date: 03.02.2020), then INTEL's linker xilink reports the following errors (and does not create the executable expected):
Code:

LIBCMT.lib(memcpy.obj) : error LNK2005: memmove already defined in clearwin64.lib(clearwin64.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: exit already defined in clearwin64.lib(clearwin64.dll)
LIBCMT.lib(unlink.obj) : error LNK2005: remove already defined in clearwin64.lib(clearwin64.dll)
LIBCMT.lib(getenv.obj) : error LNK2005: getenv already defined in clearwin64.lib(clearwin64.dll)
LIBCMT.lib(atox.obj) : error LNK2005: atoi already defined in clearwin64.lib(clearwin64.dll)
..\p64_intel\p0918w.exe : fatal error LNK1169: one or more multiply defined symbols found

. I could force xilink to ignore this (via option "/FORCE:MULTIPLE") and thus I could create the executable in question (named p0918w.exe).
But I am unsure about possible side effects and hence would like to know more about the errors/warnings.
I used commmand
Code:

dumpbin /EXPORTS clearwin64.dll

to observe that e.g. symbol exit is exported by clearwin64.dll version 8.61, but not by clearwin64.dll version 7.10. I wonder why this is the case.

Please note: clearwin64.lib is the import library supplied by SALFORD and needed for the build process using INTEL's ifort. Moreover, all the module files (and corresponding objects) needed for building have not been suppied by SALFORD and have been built by me using ifort and the module sources supplied by SALFORD in directory
Code:

FTN95\source64

of the ftn95 installation in question ( i.e. version 7.10 or version 8.61).

LIBCMT.lib is a C Link Library used (mt stands for multithreaded) and I suspect that it is used because the GUI application is built from Fortran and C/C++ sources.

Any comment is welcome.

Regards,
Dietmar
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6319
Location: Salford, UK

PostPosted: Tue May 12, 2020 12:44 pm    Post subject: Reply with quote

These C functions (including exit) are exported by the latest version of clearwin64.dll and have been included in recent versions but presumably not in the early version that you mention.

They were added for those who need these functions when combining 64 bit Silverfrost Fortran with 64 bit Silverfrost C/C++.

I don't know if there is any risk in using "/FORCE:MULTIPLE" and, at the moment I can't think of a work-around other than supplying a variant of clearwin64.dll that does not export these functions.
Back to top
View user's profile Send private message AIM Address
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 224

PostPosted: Tue May 12, 2020 2:25 pm    Post subject: Reply with quote

Paul,

using "/FORCE:MULTIPLE" results in warnings
Code:

LIBCMT.lib(memcpy.obj) : warning LNK4006: memmove already defined in clearwin64.lib(clearwin64.dll); second definition ignored
LIBCMT.lib(crt0dat.obj) : warning LNK4006: exit already defined in clearwin64.lib(clearwin64.dll); second definition ignored
LIBCMT.lib(unlink.obj) : warning LNK4006: remove already defined in clearwin64.lib(clearwin64.dll); second definition ignored
LIBCMT.lib(getenv.obj) : warning LNK4006: getenv already defined in clearwin64.lib(clearwin64.dll); second definition ignored
LIBCMT.lib(atox.obj) : warning LNK4006: atoi already defined in clearwin64.lib(clearwin64.dll); second definition ignored
..\p64_intel\p0918w.exe : warning LNK4088: image being generated due to /FORCE option; image may not run

hence the symbols of clearwin64.dll are used and the symbols of ifort's libcmt.dll ignored.

For the moment I can live with option "/FORCE:MULTIPLE" but in the long term I would appreciate, if you could supply a variant of clearwin64.dll/clearwin64.lib that do not export these functions.

By the way: does this phenomenon occur for GNU Fortran, as well?

Thanks,
Dietmar
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 -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
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