Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

Linking problems when mixing with Fortran

jlperla
Beginner
239 Views
Hi there,
I am using Intel C++ and Fortran 11.0 on Windows. I am doing my builds through nmake (actually cmake generating nmake) and occasionally visualstudio for the C++ builds.

I believe that I have compiled a fortran lib with static linking and the debug version of the runtime. The relevant compiler flags are:
"/debug:full /Od /gen-interfaces /warn:interfaces /libs:dll /threads /c /dbglibs"

linker flags are:
/INCREMENTAL:YES /debug /pdbtype:sept /NODEFAULTLIB


Now I have a C++ project where I am trying to call my function. It is using the MDd runtime dll for sure in C++.

However, when I link I get the error:
1>libifcoremdd.lib(for_main.obj) : error LNK2019: unresolved external symbol _MAIN__ referenced in function _main

Any ideas?

Thanks,
Jesse
0 Kudos
1 Reply
TimP
Honored Contributor III
239 Views
As you appear to be using Intel Fortran for Windows, you should find similar questions answered on the corresponding forum. For example, it looks like you may have the situation which calls for -nfor-main in the ifort command line.
0 Kudos
Reply