1

I am working on various C++ projects (School/Portfolio related) and I have been using the GTK+3 library for some of them. My apps are done and now I need to create the .app for my applications. I have been trying to get it working for a long time now and still without success. I am not working with xcode and compile my application with:

clang++ main.cpp _Scripts/Resources.cpp _Scripts/gui.cpp _Scripts/Game.cpp -o minesweeper `pkg-config --cflags --libs gtk+-3.0` -std=c++11

One of my projects was a replica of Minesweeper. My .app structure looks like this:

/Minesweeper.app

//Contents

///Info.plist

///MacOS

////minesweeper

////libatk-1.0.0.dylib

////libatkmm-1.6.1.dylib

////etc.dylib

///Resources

////MyAssets

I have done

install_name_tool -id "@executable_path/duplicate.dylib" original.dylib

for every dylib int otool -L minesweeper. I then did

install_name_tool -change "/usr/local/opt/glib/lib/originalDependency.dylib" "@executable_path/duplicateDependency.dylib" duplicate.dylib

for every dylib in otool -L duplicate.dylib. And finally I did

install_name_tool -change /usr/local/opt/gdk-pixbuf/lib/original.dylib "@executable_path/duplicate.dylib" minesweeper

for all the dependencies. After all this, my app is still not working and it looks like it's the Gdk_pixbuf that's failing.

I found the the gdk_pixbuf/loaders folder, but I'm not sure if I need to link that or anything. Could anybody help me get my application working?

Regards, Dani

danivdwerf
  • 234
  • 2
  • 16

2 Answers2

3

So, I guess either no-one knew it or no-one wanted to spend 3849823 years to type an answer that MIGHT have helped me. Either way, I totally understand. I've spend a lot of time researching (also before asking the question) and I've written how I successfully created the app-bundle on my website. I hope it helps someone :)

danivdwerf
  • 234
  • 2
  • 16
  • 1
    404, the link ins no longer valid. – ozw1z5rd Nov 17 '19 at 21:01
  • You are correct. I stopped with my website. I hope you will find your solution – danivdwerf Nov 19 '19 at 09:28
  • Can you give use basic instructions please? – Peter Apr 01 '20 at 18:45
  • 2
    Looks like archive.org has a copy: https://web.archive.org/web/20190514120648/https://extra.freetimedev.com/index.php?category=tutorials&subject=app-bundle – CatZilla Apr 07 '20 at 19:06
  • Sorry for not coming back at you. I haven't worked much with C++ since this project, so I haven't had the time to improve read more into creating a bundle. Basically, I used `$ otool -L myExecutable` to list all my dependencies, copied all those dependencies to a lib folder in my Resources folder. Then used the install_name_tool to change the decency path from my computer to the local lib folder in the Resources. It is very tedious and there must be a better way to do than I did. Hope you will find what you are looking for. – danivdwerf Apr 08 '20 at 06:47
1

You might find the official information about how to bundle a GTK3 application on Mac OSX. https://wiki.gnome.org/Projects/GTK+/OSX/Bundling#Bundle_File

Suyuan Chang
  • 839
  • 1
  • 7
  • 6