- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm working on an old code and trying to modify it.Original code is compiled with NPD Fortran compiler (which I've not heard before) and now I've the very classical error for you "error LNK2001: unresolved external symbol _CDAT@20".Is the problem due to the mixed version of libraries?If yes, how can I find the the right lib file?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It probably will not work to link CVF code against libraries compiled by the NPD compiler. Do you have all the sources?
If the NPD code is link-compatible with CVF, you probably still have to deal with differences in naming and calling conventions. In a Fortran Command Prompt window, do a:
dumpbin -symbols xxx.obj > dump.txt
on the object (or .lib) Then open dump.txt in NOTEPAD and look for CDAT to see how it appears. Look for lines that resemble this:
You want to see how the name CDAT appears here - is it _cdat, _CDAT, or something else?
Steve
If the NPD code is link-compatible with CVF, you probably still have to deal with differences in naming and calling conventions. In a Fortran Command Prompt window, do a:
dumpbin -symbols xxx.obj > dump.txt
on the object (or .lib) Then open dump.txt in NOTEPAD and look for CDAT to see how it appears. Look for lines that resemble this:
00C 00000000 SECT1 notype () External | _TEST@0
You want to see how the name CDAT appears here - is it _cdat, _CDAT, or something else?
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I have all the source codes.When I'm compiling these codes there is no error.The error comes during the execution of the program.
I did exactly what you said (In Fortran Command Prompt) and I'm copying the line including CDAT:
019 00000000 UNDEF notype () External | _CDAT@20
nc
I did exactly what you said (In Fortran Command Prompt) and I'm copying the line including CDAT:
019 00000000 UNDEF notype () External | _CDAT@20
nc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, the error is coming during the linking, not the execution. The line you show is of the reference to CDAT, not the declaration.
Since you have the sources - find routine CDAT and reply here with the SUBROUTINE or FUNCTION statement, and all the type declarations of its arguments. Do the same with the call to CDAT (the call statement and the types of its arguments). My guess is that you have a type mismatch.
Steve
Since you have the sources - find routine CDAT and reply here with the SUBROUTINE or FUNCTION statement, and all the type declarations of its arguments. Do the same with the call to CDAT (the call statement and the types of its arguments). My guess is that you have a type mismatch.
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page