c - About OpenMP with gnu gcc -


i have windows 8 64bit operating system.

i wanted experiment following c code openmp functionality:

hello.c program

#include <stdio.h> #include <stdlib.h> #include<omp.h>  int main() {     #pragma omp parallel     printf("hello world!\n");     return 0; } 

while tried run program command prompt using: gcc -fopenmp hello.c

i got following error:

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin d -lpthread collect2.exe: error: ld returned 1 exit status 

i have c:\mingw in path gcc 4.8.1.

what's wrong? lost.

thanks!!

thanks osgx,

as newbie couldn't make out these "pthreads" meant. after found solution problem. installed gcc 4.8.2 64 bit on machine http://www.equation.com/servlet/equation.cmd?fa=fortran. changed environment variable in path itself. after finishing installing, restarted computer , when typed:

gcc -fopenmp hello.c 

for above code in command line, code worked!!

hurray :)


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -