I have a cross-platform C++ library that I have created which supports (Windows, Linux), but I want to support macOS too, and in order to use macOS "cocoa" I must use either Objective-C or Objective-C++.
I have read a few about that subject and I found that to compile a mixed code of macOS "Cocoa" Objective-C++ and C++ you must change the C++ source file extension from ".cpp" to ".mm", so, If I do that then my library will be two versions one for Window, Linux that has ".cpp" extension and the other one for macOS that has ".mm" extension.
Hint: my library consists of 2 files ".h" for class declaration and ".cpp" for class definition.
Is that the right and only way to make a library/application to support macOS?
Inquire, to make my library support MacOS
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: Inquire, to make my library support MacOS
The development tools supplied by apple use the clang compiler. It is capable of compiling c,c++, objective c, and maybe others as well. You only need to use objective c if you want to work directly with the system libraries.
As far as gui programming does, on macOS, wxWidgets is basically a c++ wrapper around the objective c libraries.
As far as libraries go, you can still build and use a traditional library file, but usually on macOS you would build a framework. A framework basically bundles up the lib, headers, and other resource files.
As far as gui programming does, on macOS, wxWidgets is basically a c++ wrapper around the objective c libraries.
As far as libraries go, you can still build and use a traditional library file, but usually on macOS you would build a framework. A framework basically bundles up the lib, headers, and other resource files.
Re: Inquire, to make my library support MacOS
Hi,
Why do you want to interfere with the Objective-C code?
If you need a way to test you code on OSX, I can help you with that. I own 2 Mac laptops - one with 10.8 and one with 10.13.
In general all you need to do is just like on Windows/Linux - compile wxWidgets and then compile your code against it.
Then tgry it and fix the bugs that is there on OSX.
Thank you.
P.S.: You can PM me with the code for the test purposes.
Why do you want to interfere with the Objective-C code?
If you need a way to test you code on OSX, I can help you with that. I own 2 Mac laptops - one with 10.8 and one with 10.13.
In general all you need to do is just like on Windows/Linux - compile wxWidgets and then compile your code against it.
Then tgry it and fix the bugs that is there on OSX.
Thank you.
P.S.: You can PM me with the code for the test purposes.
Re: Inquire, to make my library support MacOS
I just want to use some features of "Cocoa" in my library because there's no alternative way to do that except using "cocoa".Why do you want to interfere with the Objective-C code?
Thank you, I have a virtual machine that I use to test my code on macOS.If you need a way to test you code on OSX, I can help you with that. I own 2 Mac laptops - one with 10.8 and one with 10.13.
I thank you again.P.S.: You can PM me with the code for the test purposes.
Re: Inquire, to make my library support MacOS
Hi,
My understanding is that you are violating the Apple license.
AFAIK, OSX can't be installed in VM...
But maybe I'm wrong?
Thank you.
My understanding is that you are violating the Apple license.
AFAIK, OSX can't be installed in VM...
But maybe I'm wrong?
Thank you.