Results tagged “mac” from muse

libiconv on Mac OS X 10.8.4

|

The problem with the libiconv supplied by Apple is that its symbols do not start with _lib. So instead of _libiconv_open you get _iconv_open. You can check it like this:

$ nm /usr/lib/libiconv.dylib | grep iconv_open
0000000000001c59 T _iconv_open

If you are using macports, you should get this:

$ nm /opt/local/lib/libiconv.dylib | grep iconv_open
0000000000001350 T _libiconv_open
00000000000027a0 T _libiconv_open_into

To fix this problem, you have to install the appropriate libiconv:

$ sudo port install libiconv @1.14_0+universal

Then whenever you are linking to libiconv, replace /usr/lib/libiconv.dylib with /opt/local/lib/libiconv.dylib. (Hint: Finder supports search IN files.)

Another thing worth noting is that you must make sure libiconv is targeted at the correct architecture, check it like this:

$ file /usr/lib/libiconv.2.dylib 
/usr/lib/libiconv.2.dylib: Mach-O universal binary with 2 architectures: [i386: Mach-O i386 dynamically linked shared library] [x86_64]

I was following this tutorial but had some trouble compiling, especially when I wanted to link with FFmpeg libraries, so I decided to share the makefile and save others some time in the future. My platform is Mac OS X 10.8 (Mountain Lion).

It's worth pointing out that I compiled FFmpeg and SDL from source, and installed a bunch of dependent libraries using macports.

CXX = g++
CXXFLAGS = -Wall -Wextra -pedantic -Os -I. -fPIC \
           -Wno-long-long -DNDEBUG
LDFLAGS = -framework OpenGL -framework GLUT
SH=bash

# don't forget to update the directory
FFMPEG_LIB_DIR = /mylibs/ffmpeg
FFMPEG_LIBS = -L$(FFMPEG_LIB_DIR)/libavcodec -lavcodec
FFMPEG_LIBS += -L$(FFMPEG_LIB_DIR)/libavformat -lavformat
FFMPEG_LIBS += -L$(FFMPEG_LIB_DIR)/libavutil -lavutil
FFMPEG_LIBS += -L$(FFMPEG_LIB_DIR)/libswresample -lswresample
FFMPEG_LIBS += -L$(FFMPEG_LIB_DIR)/libswscale -lswscale
FFMPEG_INCLUDES = -I$(FFMPEG_LIB_DIR)/libavcodec
FFMPEG_INCLUDES += -I$(FFMPEG_LIB_DIR)/libavformat
FFMPEG_INCLUDES += -I$(FFMPEG_LIB_DIR)/libavutil
FFMPEG_INCLUDES += -I$(FFMPEG_LIB_DIR)/libswresample
FFMPEG_INCLUDES += -I$(FFMPEG_LIB_DIR)/libswscale

# ffmpeg needs zlib
ZLIB_LIBS = $(shell pkg-config --libs zlib)

SDL_LIBS = $(shell sdl2-config --libs)
SDL_INCLUDES = $(shell sdl2-config --cflags)

CXXFLAGS += $(SDL_INCLUDES)
CXXFLAGS += $(FFMPEG_INCLUDES)
LDFLAGS += $(SDL_LIBS)
LDFLAGS += $(ZLIB_LIBS)
LDFLAGS += $(FFMPEG_LIBS)

SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
EXE = program

all: $(SRCS) $(EXE)

%.o: %.cpp
    $(CXX) -c -o $*.o $(CXXFLAGS) $*.cpp

$(EXE): $(OBJS)
    $(CXX) -o $@ $(OBJS) $(LDFLAGS)

clean:
    rm $(OBJS) $(EXE)

And here are the headers to include:

#include <OpenGL/OpenGL.h>
#include <OpenGL/gl3.h>

Fedora on MacBook Pro

|

Because of all the computer network related stuff I have been doing I decided to install a Linux OS on my macbook pro 1,2.

Tried Ubuntu first but it didn't work out very well. Upon the first startup I was able to connect to wifi and install updates. However, after updating the system and rebooting, I lost network manager and the ability to connect to wifi. I've no idea what I did to deserve this, so ended with installing Ubuntu again. This time was even worse, I couldn't even login because the keyboard and trackpad didn't work.

Basically I just gave up getting Ubuntu to work on my MBP. Fedora, however, worked very well and I must admit I really like the blue color scheme. It's cool.

Installing Fedora was quite smooth and uneventful. Although I hesitated when I realized I had to move the free space (partitioned by Boot Camp) to another sequence, but that doesn't matter. After installation I had to tweak the system for trackpad, but that's all. Everything works and I'm truly happy with Fedora.

Now come to the OS part, I don't really care about the difference between yum and apt-get, although apt-get seems to get me more packages than yum could. What I did not get at the beginning is that libraries like libnet and libpcap have a development version and another version which does NOT contain header files. Well, doing yum groupinstall "development tools" is obviously not enough.

Managing fonts on Linux is a pain in the ass, even with FontMatrix. Typographers should stick to Mac OS at all circumstances, believe me.

I'm not quite sure why Fedora doesn't come with Tomboy preinstalled, but it's a really neat software and I currently use it as an equivalent of DEVONthink on Linux, besides all my note-taking apps on the web.

A note about the virtual console on Linux, I think it's brilliant. Mac OS should definitely implement something like this, because this multiple-desktop concept, aka Spaces, is downright stupid compared the multiple-console concept. Plus, isn't it cool to copy and paste using just mouse buttons (um, using a mouse)?

Update: Read up on this guide for a detailed, step-by-step, explanation on how to get Fedora 10 working on your MBP.

I downloaded F10-i686-Live.iso and burned it onto a CD. Used Boot Camp to create a partition for Fedora, because I'm lazy. The compensation is that you will see Windows instead of Fedora, and you have to press Alt every time upon booting to select Fedora. Do not alter the size of free space created by Boot Camp, I think there will be some undesirable consequences if you did.