Upgrade to OSX/Xcode

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Upgrade to OSX/Xcode

Post by ONEEYEMAN »

Hi, ALL,
In the beginning of my development I had a Mac with OSX 10.8. I installed Xcode 5 on it, created the project and everything was working.
After confirming I pushed everything Mac-related to GitHub in addition to existing code from Windows/Linux.

Recently I bought a new Mac with 10.13 on it. I installed Xcode 9 on it.
Then I cloned my project on the new laptop, open the project, compiuled and tried to run.

The program crashed almost immediately stopping in somewhere in the initialization code in assembly.

I tried to run the binary from Terminal and got a RTE saying that the linker can't find one of the dylib's from my project inside /usr/local/lib.

I tried to ask on SO and their Apple site. I've been told that the cause is the difference between the project file.

And so my questions are:

1. Is recreating the project the only solution?
2. If yes, how do I manage different Xcode versions for the project on the GitHub?

Thank you.
BobsTheDude
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Mar 06, 2019 10:33 pm

Re: Upgrade to OSX/Xcode

Post by BobsTheDude »

Hey, I just noticed this post, did you ever resolve this issue?

Looks like you have installed the libs in /usr/local/lib, which your new system does not have installed.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Upgrade to OSX/Xcode

Post by ONEEYEMAN »

Hi,
No, I did not.
It looks like when I created the project on the old machine Xcode handled everything.
However, when I cloned everything on the new machine with new Xcode this was lost.

And I hate to re-create everything from scratch on the new machine - I'm sure there should be some kind of a tool or script that will allow to simply re-generate everything.

Didn't find it yet though

Thank you.
BobsTheDude
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Mar 06, 2019 10:33 pm

Re: Upgrade to OSX/Xcode

Post by BobsTheDude »

There is no tool or script to do what you are asking. Basically, you installed and used libraries that were installed in /usr/local/lib. Anything in /usr/lib is installed by the OS, anything in /usr/local is installed by the user. So, if you were using a macOS library it would be in /usr/lib by default.

You must have installed something by either using brew, MacPorts, fink or manually using the make install from the lib you are trying to use.

btw, if you are building a pkg to be installed on a users Mac you will run into the macOS security feature and a big warning will popup. So I keep everything I can local to the Application pkg and stay out of any macOS root systems.

If you still have the Application you developed you can do follow this tip to identify what is missing and how to reinstall.


1. Right-click on the application name
2. Select show package contents
3. Open Contents folder
4. Open macOS folder
5. In the terminal type cd then change to that folder (just drag and drop the folder into terminal).
6. Type otool -L <YOUR_APP_NAME>
This will tell you what libs are missing if any for your application.

Honestly, I would stay out of the root file system(due to Apples' security feature. Apple wants everything in its own sandbox) and either use static libs or use dylibs' but and change install location.

Also, remember any file you use outside of your application bundle will need to exist on the end-users system. They will have to install the same files on their system. And once they try to install the files they will get a BIG security warning.... And a regular end-user will probable not continue or have no idea what to do.

If you take any macOS package and:
1. Right-mouse click on an Application
2. Click show package contents
3. Open the Frameworks folder
You will notice all of the libs being included with the package.

Good luck.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Upgrade to OSX/Xcode

Post by ONEEYEMAN »

Hi,
BobsTheDude wrote: Sat Jul 20, 2019 9:43 am There is no tool or script to do what you are asking. Basically, you installed and used libraries that were installed in /usr/local/lib. Anything in /usr/lib is installed by the OS, anything in /usr/local is installed by the user. So, if you were using a macOS library it would be in /usr/lib by default.

You must have installed something by either using brew, MacPorts, fink or manually using the make install from the lib you are trying to use.
I don't even have any of those packages installed. The new Mac is what it is - new. I only installed Xcode with development tools and Firefox (all from the Store).
BobsTheDude wrote: Sat Jul 20, 2019 9:43 am btw, if you are building a pkg to be installed on a users Mac you will run into the macOS security feature and a big warning will popup. So I keep everything I can local to the Application pkg and stay out of any macOS root systems.
I'm not building anything - this is still development t stage.
And is it turns out, while I can successfully build, I can't test, because it apparently requires an install.
BobsTheDude wrote: Sat Jul 20, 2019 9:43 am If you still have the Application you developed you can do follow this tip to identify what is missing and how to reinstall.


1. Right-click on the application name
2. Select show package contents
3. Open Contents folder
4. Open macOS folder
5. In the terminal type cd then change to that folder (just drag and drop the folder into terminal).
6. Type otool -L <YOUR_APP_NAME>
This will tell you what libs are missing if any for your application.
Should I do all this from Xcode or Finder/Terminal?

As I said - I am still developing (writing code), but now I need to build this on the newer Mac, because it is newer.
And I'm using Xcode for development.
BobsTheDude wrote: Sat Jul 20, 2019 9:43 am Honestly, I would stay out of the root file system(due to Apples' security feature. Apple wants everything in its own sandbox) and either use static libs or use dylibs' but and change install location.
I'm not talking about wx library or any other 3rd party one.
I'm talking about my own dylib that I'm writing and have control over.

However, when I created the projects in my old Mac's Xcode it was created in a way so that it become installed when it is time to run.
And apparently, it looks like new Mac/Xcode does not do that.
Maybe because Apple turned on "Security" feature, maybe because of something else.
BobsTheDude wrote: Sat Jul 20, 2019 9:43 am Also, remember any file you use outside of your application bundle will need to exist on the end-users system. They will have to install the same files on their system. And once they try to install the files they will get a BIG security warning.... And a regular end-user will probable not continue or have no idea what to do.

If you take any macOS package and:
1. Right-mouse click on an Application
2. Click show package contents
3. Open the Frameworks folder
You will notice all of the libs being included with the package.

Good luck.
Please see my comments above.
I'm not talking about wx or any other libraries/frameworks - I'm talking about my own library (dylib).
BobsTheDude
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Mar 06, 2019 10:33 pm

Re: Upgrade to OSX/Xcode

Post by BobsTheDude »

Hey oneeyeman, I am a bit confused, of what is actually going on here.

"I'm not building anything - this is still a development stage.
And is it turns out, while I can successfully build, I can't test, because it apparently requires an install."

Are you using swift by chance? or Objective-c, if swift it has a special upgrade process if your version was too old, just a thought.

btw, Apple SO's are expensive, I use mine very sparingly.

If you have the project in git or somewhere or even the binary XCode generates where I can access it or even that actual build that I can test maybe I can help you get it resolved by testing on my systems.

If you cannot share your project or binary I would need a bit more information.

1. Original macOS version
2. New macOS version
3. Original Xcode version
4. New Xcode version
5. Did you use cocoa pods or carthage
6. If you are building a framework, how are you testing it?

Best would be if you can give me access to the project or binary, or hect just let me RDC in and watch what you are doing.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Upgrade to OSX/Xcode

Post by ONEEYEMAN »

Replied privately.
Let me know if you failed to clone the project or don't see it.

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Upgrade to OSX/Xcode

Post by ONEEYEMAN »

Sorry about that.
Should be sent now.

Thank you.
Post Reply