News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Mac os X bundle

Started by Trikko, September 04, 2006, 02:00:28 PM

Previous topic - Next topic

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

#2
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

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


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


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


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


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


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


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

#!/ 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"

Trikko

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


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


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.

Good idea, but is wizard ready to download? Or you do not plan to share it?
Regards, _Andrey_
[url="http://www.wegroup.org"]http://www.wegroup.org[/url]
[url="http://www.ugolnik.info"]http://www.ugolnik.info[/url]

Auria

The rez thing should NOT be used. it is for legacy stuff (classic apps)

It's much better to build an app bundle. Quick example of how to do it:

Target > Build Options > Pre/post build steps

Pre-build steps:

mkdir -p $(TARGET_OUTPUT_DIR)/MyApp.app/Contents/MacOS
mkdir -p $(TARGET_OUTPUT_DIR)/MyApp.app/Contents/Resources


post-build step:

cp $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_DIR)/MyApp.app/Contents/MacOS


This is dirty and incomplete, but if you continue in that direction, add an info.plist file, fix executable location instead of copying it, etc. you can probably get it working quite well enough

If you can make a wizard out of that, please share it, it would be awesome  :D

Fenk

I'm sorry for reviving such an old thread, but I'd really like to know if that wizard finally got made. XCode works too well to be struggling with C::B on Mac OS X  :D (although it is a wonderful alternative for most Windows IDEs). Did you guys get an automated solution to this?

afb

Quote from: Fenk on December 09, 2009, 11:52:12 AM
I'm sorry for reviving such an old thread, but I'd really like to know if that wizard finally got made.

That would be a: "no" (but patches welcome)

http://svn.berlios.de/svnroot/repos/codeblocks/trunk/src/plugins/scriptedwizard/resources/wxwidgets/wizard.script