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

error LNK2019 only with x64 platform

pierangelo_f_
Beginner
569 Views

I have a fortran main program that call the 'atof' c function.

program Console1

implicit none

interface

double precision function atof(string)

!DEC$ATTRIBUTES ALIAS : '_atof' :: atof

character*(*) string

end function atof

end interface

! Variables

character*128 string

double precision ff

! Body of Console1

string='123.e+23'

ff = atof(string//

char(0))

print *,ff

end program Console1

If I compile it for the WIN32 platform I have no problems, the EXE is generated.

If I compile it for the x64 platform I get the error LNK2019 for the _atof external reference.

Probably I have the MS Visual Studio (2005) badly configured.

Does anyone have a solution project that works correctly with WIN32 and X64 platform?

Thanks.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
569 Views

On x64, the convention is no leading underscore. Try this instead:

!DEC$ATTRIBUTES DECORATE, ALIAS : 'atof' :: atof

0 Kudos
Reply