473,387 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Linking vs8 c++ to FORTRAN static library

Dear Madam or Sir,


I encountered one problem which is quite similiar to the discussions launched at the web site:



http://www.thescripts.com/forum/thread280324.html


I am starting to compile a software for engineering calculation which is developed using MSVC v7.0 but now updating to MSVC v8.0. At the same time, the compiler we used is also updated to Intel 9.1. I encountered several problems:

Problem: Linking vs8 c++ to FORTRAN static library (using IDE Intel 9.1):

- FORTRAN 77 file as dll or static library: It works well with the .lib + .dll (compiled using an old Intel FORTRAN compiler) under the old win32 version. Now we want to use the code for x64. But we have problems to build up 64-bit .lib and .dll file using Intel 9.1 compiler. However, we encountered problem during linking C++ code with the FORTRAN library.

- So I go one step back to build the 32 -bit .lib and .dll using the new Intel 9.1 compiler. OK for compiling, but to my surprise, it won’t work when linking with the same C-code! No working.

- So I tried using static library instead, but remains the same problem as following:

- If I check the .lib file, there were two derived names for each exported functions, for example: _ZBIRY@32 and _ZBIRY@28. (The related command for that was !DEC$ ATTRIBUTES DLLEXPORT :: ZBIRY added to the FORTRAN code). But no such extension @32 or @28 were found in lib file generated using the new Intel compiler. If I additionally add !DEC$ ATTRIBUTES ALIAS:’_ZBIRY@32’ :: ZBIRY the error remains only ‘cannot find _ZBIRY@28’.

- If I add line !DEC$ ATTRIBUTES ALIAS:’_ZBIRY@32 _ZBIRY@28’ :: ZBIRY,

OR !DEC$ ATTRIBUTES ALIAS:’_ZBIRY@32 /_ZBIRY@28’ :: ZBIRY, in both case not working.



I added a smple test project to show the problems (I can send the project file if one could help) (Email xieml2007@hotmail.com).

Would you please help me?

Thanks a lot in advance for your kind help!



M. Xie

// F2CLink.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

// windows
extern "C" void _stdcall ZBIRY(double* ZR,
double* ZI,
int* ID,
int* KODE,
double* BIR,
double* BII,
int* IERR);
extern "C" void _stdcall ZAIRY(double* ZR,
double* ZI,
int* ID,
int* KODE,
double* AIR,
double* AII,
int* NZ,
int* IERR);

int _tmain(int argc, _TCHAR* argv[])
{
double fr = 0.0;
double fi = 0.0;
int nz = 0;
int ierr = 0;
int id = 0;
int kode = 2;
double argr = 1.0;
double argi = 2.0;

ZAIRY(&argr, &argi, &id, &kode, &fr, &fi, &nz, &ierr);
return 0;
}

Current error:

1>------ Build started: Project: F2CLink, Configuration: Release Win32 ------
1>Linking...
1>ZairyZbiry.lib(ZairyZbiry.obj) : warning LNK4229: invalid directive '/_ZBIRY@28' encountered; ignored
1>LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
1>Build log was saved at "file://c:\SWDev\nSights\F2CLink\F2CLink\F2CLink\Release\B uildLog.htm"
1>F2CLink - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
May 11 '07 #1
0 3951

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jeff Hagelberg | last post by:
I'm trying to create a python module which can be used by a python interpreter embedded inside a fortran program I have. To do this, I first created python wrappers for all the functions in my...
2
by: sunil | last post by:
Hi, We have lot of c and fortran archive libraries that have complex dependencies. We have different server tasks that use some of these libraries. We have developed a tool inhouse that links...
13
by: NM | last post by:
Sometimes ago I was having a problem in linking between C++ and Fortran program. That was solved (using input from this newsgroup) using the Fortran keyword "sequence" with the derived types (to...
5
by: Michael Hiegemann | last post by:
Hello, I am unaware whether this is the right group to ask. Please point me to another forum if required. I would like to replace a Fortran function by one which is written in C. The function...
2
by: | last post by:
Help! I'm new to c++, and am breaking my teeth on MS Visual C++ (bundled within Visual Studio .NET 2003). Am trying to link simple c++ code to fortran dlls created in Compaq Visual Fortran (v6.1)....
6
by: Rudy Ray Moore | last post by:
I work with a multi-project workspace. One project (the "startup" project) has a "Configuration Type" of "Application (.exe)". The other 40 projects have a "Configuration Type" of "Static Library...
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
0
by: Philip Lowman | last post by:
I am in the process of trying to migrate a couple of build solutions to Visual Studio Express 2005 from VS 2003 Professional and I am running into a weird C/C++ runtime library linking issue when...
9
by: a-lbi | last post by:
I use gcc compiler (version 2.8.1). During linking I get the following error message: Undefined first referenced symbol in file log10l ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.