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

Cross compile lib conflict problem

Jauch
Beginner
428 Views
Hi,

I'm trying to do a fortran software that uses c code, using MS Visual Studio 2005 and intel fortran 9.1.
(I'm using DEBUG mode)

The problem is that if I use the MSVCRTD, I have the "tradicional" errors like this:

MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj)

And when I use the IGNORE specific library: MSVCRTD, I get these type of errors:

output.obj : error LNK2001: unresolved external symbol __imp__longjmp

So, I don't know how to solve this question...

Any ideas????

Thanks!

0 Kudos
2 Replies
Steven_L_Intel1
Employee
428 Views
You must make sure that all sources in your application are using the same set of run-time libraries. You have some C/C++ code that is using one set, and Fortran code using another set. I think C++ defaults to the multithreaded debug DLL libraries whereas Fortran defaults to multithreaded debug static libraries.

In the C++ project, this is set under Code Generation - in Fortran, Libraries. Make these consistent and rebuild.

In 99.9% of cases, use of "ignore library" just makes the problem worse.
0 Kudos
Jauch
Beginner
428 Views
You must make sure that all sources in your application are using the same set of run-time libraries. You have some C/C++ code that is using one set, and Fortran code using another set. I think C++ defaults to the multithreaded debug DLL libraries whereas Fortran defaults to multithreaded debug static libraries.

In the C++ project, this is set under Code Generation - in Fortran, Libraries. Make these consistent and rebuild.

In 99.9% of cases, use of "ignore library" just makes the problem worse.

The visual studio came with the Runtime Library set to /MDd. I changed to /MTd, compiled the c++ code, and there's no more problem...

Thanks for the quick replay!!!
0 Kudos
Reply