0

on Mac OS X 10.7

I run this command on this file http://www.imagemagick.org/source/wand.c as they said here http://www.imagemagick.org/script/magick-wand.php

cc -o wand `pkg-config --cflags --libs MagickWand` wand.c

An error occurred:

ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

But gcc works fine:

gcc -o wand `pkg-config --cflags --libs MagickWand` wand.c

Why was that? I want to know what different between gcc and cc on this.

FYI: I installed ImageMagick follow this http://www.imagemagick.org/script/install-source.php. The only command I didn't follow is sudo ldconfig /usr/local/lib since my Mac have no ldconfig here.

mitnk
  • 3,127
  • 2
  • 21
  • 28
  • What does `ls -l \`which cc\`` say on your machine? On mine (a GNU/Linux), it is a soft link to the `gcc` binary. What about `cc --version` and `gcc --version`? – ArjunShankar Oct 09 '12 at 08:24
  • It's: `/usr/bin/cc -> clang`. clang 3.1 – mitnk Oct 09 '12 at 08:26
  • Well, I just found this: [Comparison of Diagnostics between GCC and Clang](http://gcc.gnu.org/wiki/ClangDiagnosticsComparison). Thanks, @ArjunShankar – mitnk Oct 09 '12 at 08:31
  • clang (which is *not* GCC) does not support OpenMP (yet). – ArjunShankar Oct 09 '12 at 08:36
  • Yeah, you are right. I didn't mean that link answered my question ;) – mitnk Oct 09 '12 at 08:40
  • Actually, what I said doesn't answer your question either. I wouldn't expect `clang` not to find `libgomp`. I would expect it to ignore the OpenMP `#pragma`s. I could be wrong though. – ArjunShankar Oct 09 '12 at 08:43
  • Hi, ArjunShankar. You deleted your answer --! I have read it. It's kind of informational :) Thanks for your help! – mitnk Oct 09 '12 at 08:47
  • I didn't think it fair to 'answer' because I didn't completely answer your question. It wasn't worth anything more than a comment. Anyway, good luck. – ArjunShankar Oct 09 '12 at 08:52

0 Answers0