User forums > Using Code::Blocks

Mac os X bundle

(1/2) > >>

Trikko:
Hello! I've installed c::b for mac os x and i've compiled wxWidgets. It compiles the template app but i can't run it probably becouse we need to make a bundle app. Did anyone write a post-building script to do this (or something similar) ?

Thanks in advance!

Trikko:
When i run an application built with C::B for mac it starts and quit immediatly. On console it writes:


dyld: lazy symbol binding failed: lazy pointer not found
dyld: lazy pointer not found
Trace/BPT trap

I can't understand why using the makefile given with samples they compiles without problems...

Could anyone help me?

I have just one compiler: gcc 4 for mac os x....

Pecan:

--- Quote from: Trikko on September 04, 2006, 07:24:52 pm ---When i run an application built with C::B for mac it starts and quit immediatly. On console it writes:
dyld: lazy symbol binding failed: lazy pointer not found
dyld: lazy pointer not found
Trace/BPT trap

--- End quote ---

If you would google "dyld: lazy symbol binding failed: lazy pointer not found"
you will find all sorts of solutions to this problem.

Primary reason:
gcc packaged with 10.4 should not be used with the -s option. It over strips your programs and libraries. Do a separate strip (standalone) after you've tested your program.

Other mentioned solutions:

It's possible Mac cannot find your dylib. Use something like the following to set the library pointer


--- Code: ---LIB=`pwd`
# or LIB=<path to my just compiled programs dylib>
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$LIB
export DYLD_LIBRARY_PATH
 
--- End code ---

You might also have to give your program the great Mac blessing:


--- Code: ---sudo /developer/tools/Rez -d __DARWIN__ -t APPL Carbon.r -o <my just compiled program>

--- End code ---

Otherwise you can make it into a bundle like:
http://wxforum.shadonet.com/viewtopic.php?t=6045&highlight=


See at bottom of this link the section on Bundles
http://wiki.codeblocks.org/index.php?title=Compiling_Code::Blocks_in_Mac_OS_X


--- Code: ---/Developer/Tools/SetFile -t APPL `pwd`/${1}
/developer/tools/Rez -d __DARWIN__ -t APPL Carbon.r -o `pwd`/${1}

--- End code ---

Here's an example shell command that can be modified to run your program without bundling.

--- Code: ---#!/ bin/sh
##^remove the blank before bin. It's here only to appease forum software

APP_DIR=/Users/pecan/devel/mac/trunk/src/devel/
export LD_LIBRARY_PATH=$APP_DIR:$LD_LIBRARY_PATH

LIB=$APP_DIR

DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$LIB
export DYLD_LIBRARY_PATH

#--exec $APP_DIR/codeblocks --prefix=$DIR
echo DIR=$APP_DIR
echo LIB=$LIB
echo DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
echo command line =exec $APP_DIR/codeblocks --prefix="$APP_DIR"

exec $APP_DIR/codeblocks --prefix="$APP_DIR"
 
--- End code ---

Trikko:
Now it seems to work. I've just seen solutions on google but i didn't find the SetFile / Rez one.


--- Code: ---/Developer/Tools/SetFile -t APPL `pwd`/${1}
/developer/tools/Rez -d __DARWIN__ -t APPL Carbon.r -o `pwd`/${1}

--- End code ---

By the way it's strange. Using that instructions it creates a mac os classic application. If i run from system it calls classic subsystem, if i call it from console it works as mac os x app. If i create a bundle it works as mac os x app too. But usually inside bundle the apps are not classic apps, are they?

Now i'm writing my own wizard to set post-build options too.

Thanks Pecan!

_Andrey_:

--- Quote from: Trikko on September 04, 2006, 11:50:21 pm ---Now i'm writing my own wizard to set post-build options too.

--- End quote ---

Good idea, but is wizard ready to download? Or you do not plan to share it?

Navigation

[0] Message Index

[#] Next page

Go to full version