- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
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!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Jugoslav
Message Edited by intel.software.network.support on 12-09-2005 11:03 AM
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