I am trying to build graphics/ImageMagick 6.9.9-15 on 11.1-RELEASE-p1 and I get the following error: /usr/bin/ld: cannot find -lstdc++ c++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[3]: *** [Makefile:5557: Magick++/lib/libMagick++-6.la] Error 1 From configure output it looks like it assumes gcc: checking for gcc... cc ... checking whether we are using the GNU C++ compiler... yes If I add compiler:gcc-c++11-lib to USES it builds successfully.
I have the same error. System: 11.1-STABLE r324638 Clang: 5.0.0
I need more information. IM should build fine with clang on 11.1-R. So we need to find out where the -lstdc++ comes from. Something that ImageMagick is linking against had C++ code that is linked to the -lstdc++. Can you list the options your using for ImageMagick (make showconfig) and the output of "pkg info -r gcc6"?
I was building all my ports in a chroot from scratch. Just a script that does "cd portdir && make install clean" for a list of ports. no gcc6 (or any gcc port) was installed when ImageMagick was being built. graphics/ImageMagick was being built as a dependency of graphics/inkscape. When it failed I tried building by make clean, make install in ImageMagick dir with same result. make showconfig ===> The following configuration options are available for ImageMagick-nox11-6.9.9.15,1: 16BIT_PIXEL=on: 16bit pixel support BZIP2=on: bzip2 compression support DJVU=off: DJVU format support (needs THREADS) DOCS=off: Build and/or install documentation FFTW=off: Discrete Fourier Transform support FONTCONFIG=on: X11 font configuration support FPX=off: FlashPix image format support FREETYPE=off: TrueType font rendering support GRAPHVIZ=off: Graphviz graph drawing support GSLIB=off: libgs (Postscript SHLIB) support HDRI=off: High dynamic range images support JBIG=on: JBIG image format support JPEG=on: JPEG image format support JPEG2000=on: OpenJPEG 2000 support via openjpeg LCMS2=on: Little CMS 2.x support LQR=on: Liquid Rescale support LZMA=on: LZMA compression support MODULES=off: Modules support OPENEXR=off: HDR image format support via OpenEXR OPENMP=off: Parallel processing support via OpenMP PANGO=off: Pango rendering library support PDF=off: PDF document support PERL=on: Perl scripting language support PNG=on: PNG image format support RAW=on: RAW format support SVG=off: SVG vector image format support (via librsvg) TESTS=off: Run bundled self-tests after build THREADS=off: Threading support TIFF=on: TIFF image format support WEBP=on: WebP image format support WMF=off: Windows Metafile image format support X11=off: X11 (graphics) support ===> Use 'make config' to modify these settings
The problem happens if the MODULES option is off and RAW option is on. When MODULES is on, the port builds fine. With it off, MAGICK_DEP_LIBS includes RAW_R_LIBS and RAW_R_LIBS=-L/usr/local/lib -lraw_r -lstdc++ -llcms2
The problem is in libraw not in ImageMagick. libraw_r.pc and libraw.pc contain -lstdc++ You can close the bug. Thanks for pointing me in the right direction.
See comment5. I close here.