error installing libgd in mac 10.9 - macos

I'm trying to install libgd on my mac OSX 10.9 following the instructions here (https://mikewest.org/2007/04/installing-libgd-from-source-on-os-x) and peaking on some more info here (Installing GD library for perl on MacOSX 10.6).
the main goal is to be able to install and use Circos.
i followed all the steps to install the various libraries libpgn, pibjpeg and freetype using mainly ./configure && make && make sudo install...however
1) the ./congigure command from libgd does not find the libraries that I just installed and what I get is the following:
** Configuration summary for libgd 2.1.0:
Support for Zlib: yes
Support for PNG library: no
Support for JPEG library: no
Support for VPX library: no
Support for TIFF library: no
Support for Freetype 2.x library: no
Support for Fontconfig library: no
Support for Xpm library: no
Support for pthreads: yes
i read the README file (yeeee) suggesting to use --with-png=myDirectory --with-freetype=myDir etc..i did that (not sure if it made a difference) but when I get to the make command I get the following error
Undefined symbols for architecture x86_64:
"___sincos_stret", referenced from:
_gdImageCopyRotated in gd.o
_gdAffineRotate in gd_matrix.o
_gdImageRotateNearestNeighbour in gd_interpolation.o
_gdImageRotateGeneric in gd_interpolation.o
_gdImageRotateBilinear in gd_interpolation.o
_gdImageRotateBicubicFixed in gd_interpolation.o
_filter_bessel in gd_interpolation.o
...
"_iconv", referenced from:
_do_convert in gdkanji.o
"_iconv_close", referenced from:
_do_convert in gdkanji.o
"_iconv_open", referenced from:
_do_convert in gdkanji.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libgd.la] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
...more extensive in pastie: http://pastebin.com/BuvskMPe
so I'm stuck, I'm reading online and it looks like it has to do with Xcode and gcc but I can't find out how to troubleshoot this.
any help would be awesome!!

I successfully installed it using homebrew. It was as simple as:
brew install gd
This installed lib-gd version 2.1.0_1.

Related

Installing ruby but getting error "linker command failed with exit code 1"

I'm building a GitHub Pages site and trying to install Ruby for my Mac as described here. When I run ruby-install ruby , I get the following:
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
"_rb_arithmetic_sequence_extract", referenced from:
_arith_seq_s_extract in extract.o
"_rb_ary_new_capa", referenced from:
_arith_seq_s_extract in extract.o
"_rb_ary_store", referenced from:
_arith_seq_s_extract in extract.o
"_rb_define_singleton_method", referenced from:
_Init_extract in extract.o
"_rb_path2class", referenced from:
_Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../../../.ext/arm64-darwin22/-test-/arith_seq/extract.bundle] Error 1
make[1]: *** [ext/-test-/arith_seq/extract/all] Error 2
make: *** [build-ext] Error 2
!!! Compiling ruby 3.1.2 failed!
I'm totally unfamiliar with Ruby and don't know how to make any sense of this. Any ideas? Thanks
I was running into same issue as you after following the Jekyll guide.
Christian from your comments supplied a very detailed solution and explanation as to what's caused it.
After updating to macOS 12.6 or 13.0, you might still be able to install 2.7.x and 3.x versions of Ruby with rbenv or asdf. With ruby-install, you’ll need to add the --enable-shared flag. Once 2.7.7 and 3.1.3 are released, you should no longer need to add any flags.
Install for me on Mac OS 12.6 worked with ruby-install 3.1.2 -- --enable-shared

sqlite3 install issues on mac os sierra

Hi I am very new at what im doing here. I have tried following a couple different install guides for installing ruby on rails and seem to get stuck at the same point each time and it has to do with sqlite3 it gives me an error message that looks like this. I don't know how to uninstall it so I can try to start over and do it again. Error message is below
An error occurred while installing sqlite3 (1.3.5), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.3.5' succeeds before bundling
I encountered the same error. In opening the mkmf.log file There were lines like these:
ld: warning: ignoring file /usr/local/opt/sqlite/lib/libsqlite3.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/opt/sqlite/lib/libsqlite3.dylib
Undefined symbols for architecture i386:
"_sqlite3_libversion_number", referenced from:
_t in conftest-265d8e.o
ld: symbol(s) not found for architecture i386
ld: warning: ignoring file /usr/local/opt/sqlite/lib/libsqlite3.a, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/opt/sqlite/lib/libsqlite3.a
Undefined symbols for architecture i386:
"_sqlite3_libversion_number", referenced from:
_t in conftest-265d8e.o
ld: symbol(s) not found for architecture i386
I just removed the two files to solve the problem.
rm /usr/local/opt/sqlite/lib/libsqlite3.a
rm /usr/local/opt/sqlite/lib/libsqlite3.dylib

"Undefined symbols for architecture x86_64:"

I am attempting to compile this library on mac os x Mavericks 10.9.3 64-bit: http://www.openfec.org/downloads.html
I followed the README exactly, and got this error:
Linking C shared library ../../bin/Release/libopenfec.dylib
Undefined symbols for architecture x86_64:
"_of_add_from_multiple_symbols", referenced from:
_of_linear_binary_code_backward_substitution in of_ml_tool.c.o
"_of_add_to_symbol", referenced from:
_of_linear_binary_code_decode_with_new_symbol in of_it_decoding.c.o
_of_linear_binary_code_simplify_linear_system in of_ml_decoding.c.o
_of_linear_binary_code_col_forward_elimination_pivot_reordering in of_ml_tool.c.o
_of_linear_binary_code_apply_gauss_pivoting in of_ml_tool_2.c.o
_of_linear_binary_code_inject_symbol_in_triangular_system in of_ml_tool_2.c.o
_of_linear_binary_code_solve_triangular_system in of_ml_tool_2.c.o
_of_linear_binary_code_invert_dense_system in of_ml_tool_2.c.o
...
"_of_calloc", referenced from...:
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: * [../bin/Release/libopenfec.dylib] Error 1
make[1]: * [src/CMakeFiles/openfec.dir/all] Error 2
make: *** [all] Error 2
I simply followed the README for OpenFEC's distro (found at http://www.openfec.org/downloads.html). When attempting to make, this error arises.
I have no idea what the problem is.
This is what I did after untarring the distribution:
(1.): mkdir build
(2.): cd build
(3.): cmake .. -DDEBUG:STRING=OFF
(4.): make
Any ideas?
Edit: Attempted to force cmake to use 64-bit, still didn't work.
(Tried to force it into 32-bit just for kicks, also didn't work)
FYI, if this wasn't resolved. Check that you're linking to your libraries properly.
FIND_LIBRARY(LIB_NAME_LIB lib)
TARGET_LINK_LIBRARIES(my_executable ${LIB_NAME_LIB})
In your CMakeLists.txt file.

Xcode 4 FLTK 1.3.0 undefined architecture x86_64

Hi, I am using Xcode 4 and trying to set up FLTK 1.3.0 to run Bjarne
Stroustrup's Chapter 12 FLTK Demo at the end of the chapter. I keep
getting the following error when compiling, and have no idea where to go.
I have an idea it might have to do with the linker flags, but I don't know
what flag to add and where...
Here's the error:
Undefined symbols for architecture x86_64:
"Fl_JPEG_Image::Fl_JPEG_Image(char const*)", referenced from:
Graph_lib::Image::Image(Point, String,
Graph_lib::Suffix::Encoding) in Graph.o
"Fl_GIF_Image::Fl_GIF_Image(char const*)", referenced from:
Graph_lib::Image::Image(Point, String,
Graph_lib::Suffix::Encoding) in Graph.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Are you passing the linker flags present with --use-images? try:
> fltk-config --use-images --ldflags
and check the results to make sure you're getting either the system image libs, or the ones optionally built with fltk.
I also found this to be quite useful:
fltk-config --compile test.cpp
It worked perfectly for me.
For more examples of using fltk-config check out http://www.fltk.org/doc-1.1/basics.html

iconv routines get translated to libiconv_ names and fail to link on OS X

I'm trying to build Hercules from the latest Subversion on Mac OS X 10.6. It uses the iconv library for character translations. The Hercules code uses iconv_open(), iconv(), and iconv_close(). Those routines are also present in the system library on 10.6, under those names. There's only one problem: I'm getting link failures for libiconv_open(), libiconv(), and libiconv_close().
I've hunted all over my system for where the names are being changed from iconv* to libiconv*, and not found a thing. Nothing in the Hercules code is doing this. Other folks are able to build fine on current OS X.
I'm missing something simple, but just can't find it. Help?
I got this:
checking for iconv_open in -liconv... yes
checking for iconv... yes
....
Undefined symbols:
"_libiconv_open", referenced from:
_SDL_iconv_string in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
"_libiconv", referenced from:
_SDL_iconv in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
"_libiconv_close", referenced from:
_SDL_iconv_string in SDL_iconv.o
_SDL_iconv_string in SDL_iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [build/libSDL.la] Error 1
until I removed my two other copies in /opt/local and /usr/local (from Macports and a raw build of the GNU package). Then it worked.
Beeing a bit late, in my case the following line did it (MacOS X 10.8.4):
CFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/' LDFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/' ./configure
I had to override the autotools LDFLAGS to tell the configure script to use the libraries shipped with the XCode SDK.

Resources