- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying
to use Intel Fortran Compiler v10 and Visual Studio 2005 to build two projects
migrated from MSDEV 6 with Compaq Fortran compiler (of course those projects
built without any error in MSDEV 6).
However with VS 2005 I got two error:
1. One project linked without any error, the same file used in other project got link error 2019. The project settings are identical.
2. And link error 2001 on Fortran lib when it's using the external symbol defined in C code.
Any help it's very appreciated.
Thanks in advance.....
However with VS 2005 I got two error:
1. One project linked without any error, the same file used in other project got link error 2019. The project settings are identical.
2. And link error 2001 on Fortran lib when it's using the external symbol defined in C code.
Any help it's very appreciated.
Thanks in advance.....
Link Copied
11 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please show the exact and complete text of all the messages. The numbers alone tell us very little.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve for your help.
Here is the error:
deli_lib.lib(testv.obj) : error LNK2019: unresolved external symbol _simfx@0 referenced in function testv
For code:
....
CALL simfx
....
C code:
void simfx(void)
....
I checked other post and changed to call in for to:
!dec$ attributes default, stdcall, alias:'simfx' :: simfx
First of all not sure if this is correct, however I got compiling error:
C: est estv.for(1120) : Error: This symbol has multiply declared DEC$ ATTRIBUTES ALIAS attribute. [E0]
: Error: This symbol has multiply declared DEC$ ATTRIBUTES STDCALL attribute. [E0]
C: est estv.for(1120) : Error: This symbol has multiply declared DEC$ ATTRIBUTES DEFAULT attribute. [E0]
compilation aborted for C: est estv.for (code 1)
Here is the error:
deli_lib.lib(testv.obj) : error LNK2019: unresolved external symbol _simfx@0 referenced in function testv
For code:
....
CALL simfx
....
C code:
void simfx(void)
....
I checked other post and changed to call in for to:
!dec$ attributes default, stdcall, alias:'simfx' :: simfx
First of all not sure if this is correct, however I got compiling error:
C: est estv.for(1120) : Error: This symbol has multiply declared DEC$ ATTRIBUTES ALIAS attribute. [E0]
: Error: This symbol has multiply declared DEC$ ATTRIBUTES STDCALL attribute. [E0]
C: est estv.for(1120) : Error: This symbol has multiply declared DEC$ ATTRIBUTES DEFAULT attribute. [E0]
compilation aborted for C: est estv.for (code 1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As you're changing the source code, it might be better to use ISO C binding.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, is there any way I can avoid to change source code? (my code still need to be compitable with MSDEV 6 and Linux)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For simfx, change "stdcall" to "c" and remove the alias. I don't see how this would have worked under CVF. There's something else going on you're not showing us.
Please show us the ATTRIBUTES lines for EO.
Please show us the ATTRIBUTES lines for EO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are right Steve, here is the line (in .for) I corrected and it works:
!DEC$ ATTRIBUTES C :: simfx
!DEC$ ATTRIBUTES C :: simfx1
However if I tried to use 'extern "C" void simfx()' in simfx code, and compile it as C++ I got link error on line: __declspec(dllimport). I had to remove extern "C" and compile it as C then it has no link error.
simfx c code:
void simfx_common()
.....
void simfx () {
simfx_common();
.....}
void simfx1() {
simfx_common();
.....}
However I still have another issue in this code (next link error):
testv.lib(dual.obj) : error LNK2019: unresolved external symbol _dummy_counter@0 referenced in function _visin
testv.lib(dual.obj) : error LNK2019: unresolved external symbol _initlog@0 referenced in function _visin
testv.lib(dual.obj) : error LNK2019: unresolved external symbol _trnl@24 referenced in function _visin
The way it's in .for code:
....
ISTATUS = dummy_counter()
....
ISTATUS = initcaelog()
....
ISTATUS = TRNL('RUN_VISUAL',LOG_LEN,INTERFACE,0)
all declared in a seperate lib which I linked to my C project, I have no control on that lib, how I could get rid of such link errors?
Thanks a million.
!DEC$ ATTRIBUTES C :: simfx
!DEC$ ATTRIBUTES C :: simfx1
However if I tried to use 'extern "C" void simfx()' in simfx code, and compile it as C++ I got link error on line: __declspec(dllimport). I had to remove extern "C" and compile it as C then it has no link error.
simfx c code:
void simfx_common()
.....
void simfx () {
simfx_common();
.....}
void simfx1() {
simfx_common();
.....}
However I still have another issue in this code (next link error):
testv.lib(dual.obj) : error LNK2019: unresolved external symbol _dummy_counter@0 referenced in function _visin
testv.lib(dual.obj) : error LNK2019: unresolved external symbol _initlog@0 referenced in function _visin
testv.lib(dual.obj) : error LNK2019: unresolved external symbol _trnl@24 referenced in function _visin
The way it's in .for code:
....
ISTATUS = dummy_counter()
....
ISTATUS = initcaelog()
....
ISTATUS = TRNL('RUN_VISUAL',LOG_LEN,INTERFACE,0)
all declared in a seperate lib which I linked to my C project, I have no control on that lib, how I could get rid of such link errors?
Thanks a million.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not enough information - I'd need to see the actual library and code. If you want to submit an Intel Premier Support issue and attach a ZIP of your projects and ask that it be assigned to me, I'll take a look.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, I am trying to find a way how to submit the support request as I can't send any code to you guys due to data issues.
However, I did another test and put those modules under another projetc (in same solution) and there is no link errors, what could cause such errors under my current project?
However, I did another test and put those modules under another projetc (in same solution) and there is no link errors, what could cause such errors under my current project?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Problem fixed, automated conversion set /iface:cvf instead of /iface:cref (OK for another project but not for the current one), maybe the bug in automated conversion tool?.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you have /iface:cref in the CVF project? If so, then yes, that's a tool bug and please report it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the only reason is: you must link some lib files, while Microsoft change these lib files and they forget to tell you, or you need see some more informations about the changes from vc6 to vs2005!
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