PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Link errors in 64-bit Visual FORTRAN
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Hank Brandenburg



Joined: 22 Aug 2013
Posts: 12

PostPosted: Wed Sep 18, 2013 11:10 am    Post subject: Link errors in 64-bit Visual FORTRAN Reply with quote

I have a project that compiles, links and runs fine on a 32-bit windows 7 machine using VS 2010. I recently set up a new machine with a 64-bit version of Windows 8 and VS2012. The program compiles all modules fine, but produces an "unresolved external symbol" error for all of the subroutines and functions in the project. This happens using both the VS IDE and command line compiles.

I suspect some configuration problem on the new machine Any ideas on fixing this would be appreciated!
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Thu Sep 19, 2013 9:16 am    Post subject: Reply with quote

Hi Hank,

This error mean that some libraries or object are not being added to your link. Some things to check:

    All required external libraries are being added
    The directory where the libraries are located is configured
    The libraries added are the same "bitness" as your compile (i.e. 64-bit)
    The same optimization flags you add to the compilation are added to the link since some optimization flags will cause additional PGI libraries to be added.
    Some DLL libraries require you to link and compile dynamically, i.e. "-Bdynamic"


Do you have an example of the unresolved references? Are there other errors such as "can't find the library"? More details may help me determine which of the above are causing the problem.

- Mat
Back to top
View user's profile
Hank Brandenburg



Joined: 22 Aug 2013
Posts: 12

PostPosted: Thu Sep 19, 2013 9:45 am    Post subject: Reply with quote

Hi Mat,

Thanks for the response. I've done some research on the issue and found that the project compiles, links and runs fine when created as a 32-bit console application, but fails at link time with a 64-bit configuration. I examined the BuildLog for each and a excerpts are here:


32-bit project that works:

c:\program files (x86)\pgi\win32\13.8\bin\pgfortran.exe -Wl,
/libpath:"c:\program files (x86)\pgi\win32\13.8\lib" -Wl,
/libpath:"C:\Program Files\PGI\Microsoft Open Tools 11\lib" -Wl,
/libpath:"C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86" -Yl,
"C:\Program Files\PGI\Microsoft Open Tools 11\bin" -g -Bstatic
-o "XXX.exe" <various object files>

64-bit project that fails:

c:\program files\pgi\win64\13.8\bin\pgfortran.exe -Wl,
/libpath:"c:\program files\pgi\win64\13.8\lib" -Wl,
/libpath:"C:\Program Files\PGI\Microsoft Open Tools 11\lib\amd64" -Wl,
/libpath:"C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64" -Yl,
"C:\Program Files\PGI\Microsoft Open Tools 11\bin\amd64" -g -Bstatic
-o "XXX.exe" <various object files>"


I'm guessing that the paths to the library folders may not be correct and am doing some experimenting with that. I'll check your other suggestions as well.

I did create a very simple project with default settings and one subroutine and it compiled and linked properly in 64-bit mode.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Thu Sep 19, 2013 9:54 am    Post subject: Reply with quote

Quote:
I'm guessing that the paths to the library folders may not be correct
No, the paths are fine. They are all pointing to the directories where the 64-bit libraries are located.

Do you have an example of the error?

- Mat
Back to top
View user's profile
Hank Brandenburg



Joined: 22 Aug 2013
Posts: 12

PostPosted: Thu Sep 19, 2013 2:28 pm    Post subject: Reply with quote

Hi Mat,

Here are a few errors. There are about 100 modules and they all generate something similar:

Command exit code: 2

Command output: [WIRE.obj : error LNK2001: unresolved external symbol data_

REFLC.obj : error LNK2001: unresolved external symbol data_

SBF.obj : error LNK2001: unresolved external symbol data_

TBF.obj : error LNK2001: unresolved external symbol data_

TRIO.obj : error LNK2019: unresolved external symbol data_ referenced in function trio_
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
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 © phpBB Group