Inquire, to make my library support MacOS

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
User avatar
lionking
Earned a small fee
Earned a small fee
Posts: 17
Joined: Sun Apr 07, 2019 6:07 pm

Inquire, to make my library support MacOS

Post by lionking »

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?
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Inquire, to make my library support MacOS

Post by New Pagodi »

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.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7461
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Inquire, to make my library support MacOS

Post by ONEEYEMAN »

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.
User avatar
lionking
Earned a small fee
Earned a small fee
Posts: 17
Joined: Sun Apr 07, 2019 6:07 pm

Re: Inquire, to make my library support MacOS

Post by lionking »

Why do you want to interfere with the Objective-C code?
I just want to use some features of "Cocoa" in my library because there's no alternative way to do that except using "cocoa".
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.
Thank you, I have a virtual machine that I use to test my code on macOS.

P.S.: You can PM me with the code for the test purposes.
I thank you again.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7461
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Inquire, to make my library support MacOS

Post by ONEEYEMAN »

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.
Post Reply