Quantcast
Channel: Intel® Fortran Composer XE
Viewing all articles
Browse latest Browse all 1424

Unresolved externals

$
0
0

I'm using the 30-day trial of the Intel Visual Studio 2015 with C++ and FORTRAN compilers. I'm evaluating for purchase and need some help please.

When trying to build a simple mixed language project with a C++ main calling a FORTRAN subroutine I get LNK2019, unresolved external symbol for "_sqrtf in function _G6".  The code is as follows:

--- C++ code ---

#included <cstdlib>

extern "C" void _cdecl G6();

using namespace std;

int main( void )

{

    G6();

    return 0;

}

--- FORTRAN code ---

       SUBROUTINE G6

       IMPLICIT NONE

       REAL SUM

       REAL ROOTSUM

       SUM = 1 + 2.5

       ROOTSUM = SQRT(SUM)

       END

---------------------------------------------

The FORTRAN code is compiled as a static library and linked into the C++ project.

Relevant information:

1. When compiled as a Release version the code compiles and executes properly.  When compiled as a Debug version the unresolved error occurs.

2. I think I'm linking in the Intel libraries correctly in the project settings - the ones in the compiler\lib\ia32 and intel64 directories.

3. The above applies to a 32 bit project.  When I switch to a 64 bit project I get error #10310: "Failed to enable trusted storage check for licensing."  I will also need to correct this because we will need to compile 64 bit code.  If possible, please let me know how to resolve this when responding to the above problem - If necessary I can make this a separate question.

Thanks

Ken W.

 


Viewing all articles
Browse latest Browse all 1424

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>