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

openMP and LNK2019 error!!!

arvinfx
Beginner
989 Views
Hi

I try to write simple code for multiprocessing but I have error lnk2019 !
The code is:

Program testme
use omp_lib
implicit none
integer numproc
numproc=-1
numproc=omp_get_num_procs()
print *,numproc
end program testme

And this is my information:

Cpu : AMD Phenon2-940 3000Ghz

Where is my problem guys?

0 Kudos
6 Replies
TimP
Honored Contributor III
989 Views
Apparently, you didn't turn on the OpenMP option in Visual Studio Fortran properities for your project. You make an explicit
OpenMP function call, so you must instruct ifort to compile and link with OpenMP.
0 Kudos
Arjen_Markus
Honored Contributor II
989 Views
Have you turned on the OpenMP option? It is part of the preprocessor options in Visual Studio.

Regards,

Arjen
0 Kudos
Steven_L_Intel1
Employee
989 Views
Fortran > Language options...
0 Kudos
arvinfx
Beginner
989 Views
Thanks to all it is work now.
0 Kudos
mohsenmola
Beginner
989 Views
Hi
I have a similar problem. what do yo do exactly to solve the problem withLNK2019?
Thanks
0 Kudos
Steven_L_Intel1
Employee
989 Views
Are you also using OpenMP? LNK2019 could have many different causes, depemding on your program
0 Kudos
Reply