Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28446 Discussions

Calling fortran function or procedure from a c main

fly_email
Beginner
210 Views
Hi, all
I'm new with fortran
I'm trying to migrate a HP3000 application.
My problem is to build a static or dynamic fortran library.
The main program is a c program.
I've got unresolved when linking the c main.
Example:
aff error LNK2001: symbole externe non rsolu _for_cpystr
I'm using :
Intel Fortran Compiler Integration for Microsoft Visual Studio .NET 2003, Version 9.0.2713.2003, Copyright (C) 2002-2005 Intel Corporation
The library is for the moment static.
Do i have do add lib to the c project ?
Thanks in advance.
Franck.
0 Kudos
2 Replies
fly_email
Beginner
210 Views

Oh,

I think i've found the solution

I've had /MTd in the Additionnal Options of the command line/LibrarianProject property page ...

Is it the right solution ?

Franck.

0 Kudos
TimP
Honored Contributor III
210 Views
If your project is plain C, it may be simpler to try ifort as the linking command. for_cpystr comes from one of the libraries supplied with ifort. ifort would choose the correct libraries from that group.
MT libraries are required for thread safety; if you don't use threading or OpenMP, they may not be the best choice.
0 Kudos
Reply