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

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -