View Single Post
Old 7th January 2008, 05:01 PM   #3
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Compiling for GNU/Linux, OSX, and XP

So I've created a script for OSX; however, I get the following error when I try to run it.
Code:
i686-apple-darwin9-g++-4.0.1: ppc: No such file or directory
It looks like the compiler doesn't like the UNIVERSAL variable. Any ideas?

Code:
#!/bin/bash
UNIVERSAL="-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
CFLAGS="-dynamic -DMAC -DMACINTOSH -I$INCLUDE $UNIVERSAL"
CC=g++
LD=g++ 
    
function compile {
    $CC $CFLAGS -c $PROG.cpp
}
function linkIt {
    $LD $CFLAGS -shared $PROG.o -o $PROG.p
}   
    
if [ $1 ]; then
    PROG=$1
    echo 'Compiling '
    compile
    echo 'Linking'
    linkIt
else
    echo "Usage: compile <prog name>"
fi
conzar is offline   Reply With Quote