- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have build many FORTRAN x32 DLL's utilizing VS2008 and Intel(R) Visual Fortran 11.1.038.
When we try "upgrade" to x64 we always get the following error when attempting to build:
Build Log Build started: Project: test, Configuration: x64|x64 Output Compiling with Intel(R) Visual Fortran 11.1.038 [Intel(R) 64]... ifort /nologo /iface:cvf /module:"x64\x64\\" /object:"x64\x64\\" /libs:static /threads /c /Qvc9 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64" "E:\AST_SOFT\Soft_dev\Solid\UniGr\UG_Nuform\test\UG_NUFORM_DLL.for" Compiling manifest to resources... rc.exe /fo "E:\AST_SOFT\Soft_dev\Solid\UniGr\UG_Nuform\test\x64\x64\test.dll.embed.manifest.res" "E:\AST_SOFT\Soft_dev\Solid\UniGr\UG_Nuform\test\x64\x64\test.dll.embed.manifest.rc" Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 Copyright (C) Microsoft Corporation. All rights reserved. Linking... Link /OUT:"x64\x64\test.dll" /NOLOGO /MANIFEST /MANIFESTFILE:"E:\AST_SOFT\Soft_dev\Solid\UniGr\UG_Nuform\test\x64\x64\test.dll.intermediate.manifest" /IMPLIB:"E:\AST_SOFT\Soft_dev\Solid\UniGr\UG_Nuform\test\x64\x64\test.lib" "x64\x64\UG_NUFORM_DLL.obj" "E:\AST_SOFT\Soft_dev\Solid\UniGr\UG_Nuform\test\x64\x64\test.dll.embed.manifest.res" Link: executing 'link' Creating library E:\AST_SOFT\Soft_dev\Solid\UniGr\UG_Nuform\test\x64\x64\test.lib and object E:\AST_SOFT\Soft_dev\Solid\UniGr\UG_Nuform\test\x64\x64\test.exp libifcoremt.lib(for_main.obj) : error LNK2019: unresolved external symbol MAIN__ referenced in function main x64\x64\test.dll : fatal error LNK1120: 1 unresolved externals test - 2 error(s), 0 warning(s) The following is the simple subroutine that is the sole member of the project/DLL:
Subroutine UG_NUFORM_DLL [dllexport] (ArgsIn) !DEC$ ATTRIBUTES ALIAS:'UG_NUFORM_DLL' :: UG_NUFORM_DLL !DEC$ ATTRIBUTES STDCALL :: UG_NUFORM_DLL !DEC$ ATTRIBUTES REFERENCE :: ArgsIn C C (c) A. S. Thomas, Inc. 2006 C All rights reserved. C C ======================================================= C C The program translates UG file into C LEVEL I and LEVEL II outputs C C ======================================================= IMPLICIT NONE ! character*256 ArgsIn ! character*256 command_line common /cmd_line/command_line ! !=================================================================================== !==================================================================================== command_line=ArgsIn return C END
This test DLL builds when built using x86.. What is necessary to get a working DLL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect to see the /DLL option in the link command, but it's not there. I don't see anything obvious in the project file you posted (though I did ask for it to be attached as a file.) If I take this project file it builds fine with VS2008 and the oldest compiler I have, 12.1.
All I can suggest is to add /DLL to Linker > Command Line > Additional Options and see what happens. I see that this project references a separate library - what happens if you remove that from the Linker > Input property page? (Since it doesn't seem to be used.) I doubt this makes a difference, however.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How did you do this "upgrade"? It looks to me as if the project is not set as a DLL project type. Please attach the .vfproj file from this project so I can see what the project settings are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<?xml version="1.0" encoding="UTF-8"?> <VisualStudioProject ProjectType="typeDynamicLibrary" ProjectCreator="Intel Fortran" Keyword="Dll" Version="11.0" ProjectIdGuid="{B322A008-C53D-4854-80C0-5EE106ED94EE}"> <Platforms> <Platform Name="Win32"/> <Platform Name="x64"/></Platforms> <Configurations> <Configuration Name="Debug|Win32" ConfigurationType="typeDynamicLibrary"> <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Interfaces="true" WarnInterfaces="true" CallingConvention="callConventionCVF" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebugDLL"/> <Tool Name="VFLinkerTool" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemWindows" LinkDLL="true" AdditionalDependencies="$(AST_SOFT)\soft_image\string_dec\release\string_dec.lib"/> <Tool Name="VFResourceCompilerTool"/> <Tool Name="VFMidlTool" SuppressStartupBanner="true"/> <Tool Name="VFCustomBuildTool"/> <Tool Name="VFPreLinkEventTool"/> <Tool Name="VFPreBuildEventTool"/> <Tool Name="VFPostBuildEventTool"/> <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration> <Configuration Name="Release|Win32" ConfigurationType="typeDynamicLibrary"> <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" RuntimeLibrary="rtMultiThreadedDLL"/> <Tool Name="VFLinkerTool" SuppressStartupBanner="true" SubSystem="subSystemWindows" LinkDLL="true"/> <Tool Name="VFResourceCompilerTool"/> <Tool Name="VFMidlTool" SuppressStartupBanner="true"/> <Tool Name="VFCustomBuildTool"/> <Tool Name="VFPreLinkEventTool"/> <Tool Name="VFPreBuildEventTool"/> <Tool Name="VFPostBuildEventTool"/> <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration> <Configuration Name="x64|Win32" ConfigurationType="typeDynamicLibrary"> <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" CallingConvention="callConventionCVF"/> <Tool Name="VFLinkerTool" SuppressStartupBanner="true" AdditionalDependencies="$(AST_SOFT)\soft_image\string_dec\x64\string_dec.lib"/> <Tool Name="VFResourceCompilerTool"/> <Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/> <Tool Name="VFCustomBuildTool"/> <Tool Name="VFPreLinkEventTool"/> <Tool Name="VFPreBuildEventTool"/> <Tool Name="VFPostBuildEventTool"/> <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration> <Configuration Name="Debug|x64" ConfigurationType="typeDynamicLibrary"> <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Interfaces="true" WarnInterfaces="true" CallingConvention="callConventionCVF" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebugDLL"/> <Tool Name="VFLinkerTool" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemWindows" LinkDLL="true" AdditionalDependencies="$(AST_SOFT)\soft_image\string_dec\release\string_dec.lib"/> <Tool Name="VFResourceCompilerTool"/> <Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/> <Tool Name="VFCustomBuildTool"/> <Tool Name="VFPreLinkEventTool"/> <Tool Name="VFPreBuildEventTool"/> <Tool Name="VFPostBuildEventTool"/> <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration> <Configuration Name="Release|x64" ConfigurationType="typeDynamicLibrary"> <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" RuntimeLibrary="rtMultiThreadedDLL"/> <Tool Name="VFLinkerTool" SuppressStartupBanner="true" SubSystem="subSystemWindows" LinkDLL="true"/> <Tool Name="VFResourceCompilerTool"/> <Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/> <Tool Name="VFCustomBuildTool"/> <Tool Name="VFPreLinkEventTool"/> <Tool Name="VFPreBuildEventTool"/> <Tool Name="VFPostBuildEventTool"/> <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration> <Configuration Name="x64|x64" ConfigurationType="typeDynamicLibrary"> <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" CallingConvention="callConventionCVF"/> <Tool Name="VFLinkerTool" SuppressStartupBanner="true"/> <Tool Name="VFResourceCompilerTool"/> <Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/> <Tool Name="VFCustomBuildTool"/> <Tool Name="VFPreLinkEventTool"/> <Tool Name="VFPreBuildEventTool"/> <Tool Name="VFPostBuildEventTool"/> <Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration></Configurations> <Files> <Filter Name="Header Files" Filter="fi;fd"/> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"/> <Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl"> <File RelativePath=".\UG_NUFORM_DLL.for"/></Filter></Files> <Globals/></VisualStudioProject>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are building the x64/x64 configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect to see the /DLL option in the link command, but it's not there. I don't see anything obvious in the project file you posted (though I did ask for it to be attached as a file.) If I take this project file it builds fine with VS2008 and the oldest compiler I have, 12.1.
All I can suggest is to add /DLL to Linker > Command Line > Additional Options and see what happens. I see that this project references a separate library - what happens if you remove that from the Linker > Input property page? (Since it doesn't seem to be used.) I doubt this makes a difference, however.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding the /DLL to the linker command line solved the problem for building the x64 variant. We are surprised that such is present in the x86 variant.
Thank you
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page