Crash 'EXC_BAD_ACCESS' when calling CreateDatabase() in C++ VSDK

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Jun 22 06:56:51 CDT 2006


On 6/22/06 5:15 AM, "Matthew Jew" <mjew at icnc.com> wrote:

> Ok, I think I figured out how to move the VSDK2 libraries into my app.
> (I was putting the copy files phase after the link phase; it should
> be before the link phase, I guess.)

NO. it should be after link.

Let me describe picture again:

1) you install VSDK.
        
        VComponents have few Valentina dlls.

2) you make project which point that dlls in VComponents

        see VSDK examples project.

3) you build app.

        result you get myapp.app package

Up to know all is clear, yes?

-------------------------------------
4) for DEBUG target it works right now.

    you can press debug, myapp starts, loads VComponents dlls.
    perfect, you can debug.


5) for DEPLOYMENT you need install VComponents folder INSIDE of your
myapp.app For this you do easy steps:

    * open package

    * copy the whole VComponents folder into myapp/Contents

    * open terminal

    * cd to myapp.app/Contents/Vcomponents

    * drag file change_names_icu_vcomponents.sh into terminal window
            ENTER.

    * DONE.


Now you an copy myapp.app to other computer, and it works.


6) it is possible in the your project make new build phase "Run Script"
    where specify script which will do this job. In ideal this script should
    work only for RELEASe target but I don't know how todo this ... All
    our projects use script for DEBUG also (but this bring new issue of
    xcode glitch, that require small workaround)


This is example of our script from Vserver xcode project:
    again -- executed AFTER link phase

Also note, that I plan today or tomorrow setup our xcode engine projects to
use ICU from OS X...then VComponents folder for xcode-made products
(VSDK, V4REV, VSTudio, Vserver) say goodbuy to ICU dlls. Also this means
that this script will become 2 times simpler and smaller....

Also note, in the project settings we add manually once few lines of
settings as

   VserverDllName             libvserver_ppc_debug      for DEBUG
                              libvserver_fat_release    for RELEASE

And script use these settings.

P.S. At first you need get used to manual way of VComponents setup for
RELEASE build. On our site in news pointed third party utility todo this by
drag and drop...


##########################################
# vserver.dll:

cp "$BUILT_PRODUCTS_DIR//$VserverDllName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"

# RZ: workaround of xcode glitch: it loads vserver.dll 2 times from 2
locations. This cause crash
# to avoid this - we REMOVE original dll in old location.
rm "$BUILT_PRODUCTS_DIR//$VserverDllName"

install_name_tool -id "@executable_path/$VserverDllName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"
install_name_tool -change
"/usr/local/lib/vcomponents/VSDK.framework/Versions/A/VSDK"
"@executable_path/../VComponents/VSDK.framework/Versions/A/VSDK"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"
install_name_tool -change "/usr/local/lib/vcomponents/libicudata.dylib"
"@executable_path/../VComponents/libicudata.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"
install_name_tool -change "/usr/local/lib/vcomponents/libicuuc.dylib"
"@executable_path/../VComponents/libicuuc.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"
install_name_tool -change "/usr/local/lib/vcomponents/libicui18n.dylib"
"@executable_path/../VComponents/libicui18n.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"
install_name_tool -change "/usr/local/lib/vcomponents/libicuio.dylib"
"@executable_path/../VComponents/libicuio.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"
install_name_tool -change "/usr/local/lib/vcomponents/$SharedLibName"
"@executable_path/../VComponents/$SharedLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"
install_name_tool -change "/usr/local/lib/vcomponents/$KernelLibName"
"@executable_path/../VComponents/$KernelLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$VserverDllName"


##########################################
# VComponents folder:

if [ ! -d "$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents" ] ; then
    mkdir "$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents"
fi


##########################################
# COPY VSDK.framework 1.x:

if [ ! -d 
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/VSDK.framework" ] ;
then
    cp -R "../../kernel/xcode/v1/VSDK.framework"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents"

    # change id VSDK
    install_name_tool -id
"@executable_path/../VComponents/VSDK.framework/Versions/A/VSDK"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/VSDK.framework/Version
s/A/VSDK"
fi


##########################################
# COPY engine dlls:

cp "/usr/local/lib/vcomponents/$KernelLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents"
cp "/usr/local/lib/vcomponents/$SharedLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents"


##########################################
# change id of VSHARED:

install_name_tool -id "@executable_path/../VComponents/$SharedLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/$SharedLibName"


##########################################
# change id of VKERNEL:

install_name_tool -id "@executable_path/../VComponents/$KernelLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/$KernelLibName"
install_name_tool -change "/usr/local/lib/vcomponents/$SharedLibName"
"@executable_path/../VComponents/$SharedLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/$KernelLibName"
install_name_tool -change
"/usr/local/lib/vcomponents/VSDK.framework/Versions/A/VSDK"
"@executable_path/../VComponents/VSDK.framework/Versions/A/VSDK"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/$KernelLibName"
install_name_tool -change "/usr/local/lib/vcomponents/libicudata.dylib"
"@executable_path/../VComponents/libicudata.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/$KernelLibName"
install_name_tool -change "/usr/local/lib/vcomponents/libicuuc.dylib"
"@executable_path/../VComponents/libicuuc.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/$KernelLibName"
install_name_tool -change "/usr/local/lib/vcomponents/libicui18n.dylib"
"@executable_path/../VComponents/libicui18n.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/$KernelLibName"
install_name_tool -change "/usr/local/lib/vcomponents/libicuio.dylib"
"@executable_path/../VComponents/libicuio.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/$KernelLibName"


##########################################
# ICU:

cp /usr/local/lib/vcomponents/libicudata.dylib
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicudata.dylib"
cp /usr/local/lib/vcomponents/libicui18n.dylib
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicui18n.dylib"
cp /usr/local/lib/vcomponents/libicuio.dylib
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicuio.dylib"
cp /usr/local/lib/vcomponents/libicuuc.dylib
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicuuc.dylib"

# change id of data library
install_name_tool -id "@executable_path/../VComponents/libicudata.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicudata.dylib"

# change id and dependencies in common library
install_name_tool -id "@executable_path/../VComponents/libicuuc.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicuuc.dylib"
install_name_tool -change "/usr/local/lib/vcomponents/libicudata.dylib"
"@executable_path/../VComponents/libicudata.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicuuc.dylib"

# change id and dependencies in i18n library
install_name_tool -id "@executable_path/../VComponents/libicui18n.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicui18n.dylib"
install_name_tool -change "/usr/local/lib/vcomponents/libicudata.dylib"
"@executable_path/../VComponents/libicudata.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicui18n.dylib"
install_name_tool -change "/usr/local/lib/vcomponents/libicuuc.dylib"
"@executable_path/../VComponents/libicuuc.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicui18n.dylib"

# change id and dependencies in io library
install_name_tool -id "@executable_path/../VComponents/libicuio.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicuio.dylib"
install_name_tool -change "/usr/local/lib/vcomponents/libicuuc.dylib"
"@executable_path/../VComponents/libicuuc.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicuio.dylib"
install_name_tool -change "/usr/local/lib/vcomponents/libicudata.dylib"
"@executable_path/../VComponents/libicudata.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicuio.dylib"
install_name_tool -change "/usr/local/lib/vcomponents/libicui18n.dylib"
"@executable_path/../VComponents/libicui18n.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/libicuio.dylib"


##########################################
# Copy VResources folder:

if [ ! -d "$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/VResources"
] ; then
    mkdir "$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/VResources"
    mkdir 
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/VResources/English"
fi
cp -f ../../sources/VKernel/FBL/prot/Errors/kernel_errors.xml
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/VResources/English"
cp -f ../../sources/VKernel/VSQL/Errors/xml/sql_errors.xml
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/VComponents/VResources/English"


##########################################
# This Executable:

install_name_tool -change "/usr/local/lib/$VserverDllName"
"@executable_path/$VserverDllName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$PRODUCT_NAME"

install_name_tool -change
"/usr/local/lib/vcomponents/VSDK.framework/Versions/A/VSDK"
"@executable_path/../VComponents/VSDK.framework/Versions/A/VSDK"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$PRODUCT_NAME"
install_name_tool -change "/usr/local/lib/vcomponents/libicudata.dylib"
"@executable_path/../VComponents/libicudata.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$PRODUCT_NAME"
install_name_tool -change "/usr/local/lib/vcomponents/libicuuc.dylib"
"@executable_path/../VComponents/libicuuc.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$PRODUCT_NAME"
install_name_tool -change "/usr/local/lib/vcomponents/libicui18n.dylib"
"@executable_path/../VComponents/libicui18n.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$PRODUCT_NAME"
install_name_tool -change "/usr/local/lib/vcomponents/libicuio.dylib"
"@executable_path/../VComponents/libicuio.dylib"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$PRODUCT_NAME"
install_name_tool -change "/usr/local/lib/vcomponents/$SharedLibName"
"@executable_path/../VComponents/$SharedLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$PRODUCT_NAME"
install_name_tool -change "/usr/local/lib/vcomponents/$KernelLibName"
"@executable_path/../VComponents/$KernelLibName"
"$BUILT_PRODUCTS_DIR/VServer.app/Contents/MacOS/$PRODUCT_NAME"



##########################################
# Databases and licenses folders for debugging:

if [ ! -d "$BUILT_PRODUCTS_DIR/Databases" ] ; then
    mkdir "$BUILT_PRODUCTS_DIR/Databases"
fi

if [ ! -d "$BUILT_PRODUCTS_DIR/licences" ] ; then
    cp -R "/PARADIGMA/UPLOAD/2.0/license_mac" "$BUILT_PRODUCTS_DIR"
    mv "$BUILT_PRODUCTS_DIR/license_mac/" "$BUILT_PRODUCTS_DIR/licences/"
fi

 





More information about the Valentina mailing list