Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29329 Discussions

link error when using Visual Fortran Call C++

will_cn
Beginner
800 Views
I just wanna call C++ code in fortran program,and the environment is MS VC6 + digital Visual Fortran.I ignored the conflicted libc.lib,but it still came with some link error like that:

Linking...
dfor.lib(for_init.obj) : error LNK2001: unresolved external symbol ___argv
dfor.lib(for_init.obj) : error LNK2001: unresolved external symbol ___argc
dfor.lib(for_init.obj) : error LNK2001: unresolved external symbol __pctype
dfor.lib(for_io_util.obj) : error LNK2001: unresolved external symbol __pctype
dfor.lib(for_init.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
dfor.lib(for_io_util.obj) : error LNK2001: unresolved external symbol ___mb_cur_max
dfor.lib(for_diags.obj) : error LNK2001: unresolved external symbol __sys_nerr

my original code is showed here:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! fortran main code !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
PROGRAM MAIN

INTERFACE TO SUBROUTINE WINOPEN [C,ALIAS:'_WINOPEN'] ()
END

DO i = 1, 700
DO j = 1, 1000
END DO
END DO

call WINOPEN()

END


////////////////////
// c++ code //
///////////////////
#include
#include "...h"
#include "...h"


extern "C" {
void WINOPEN () ;
}

void WINOPEN ()
{
int i = 0;
float a=1.0, b=2.0;

....
....

}

How can I resolve this problem!

0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
800 Views
See here and newsletter links therein. Briefly, "Ignore libraries" is the wrong cure -- instead, you must ensure that run-time libraries used on "Fortran" and "C++" tab of project settings are the same.

Jugoslav

Message Edited by intel.software.network.support on 12-09-2005 11:03 AM

0 Kudos
Reply