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.....
連結已複製
11 回應
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)
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.
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.
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.
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?
