Guidance Forums / wxWidgets (wxWindows) in C++ / wxWidgets, Dev-C++ and Mac

Search 搜索
Home Home

Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxWidgets, Dev-C++ and Mac
Posted by: 2004-04-13 22:57:35

i did an application with Dev-C++ and wxWidgets. I want to port it under Mac. I installed wxWidgets libs for Mac and tried to compile my app. But i have a problem with the makefile. I can't find a working makefile for Mac to compile my app. can you help me ?
Message2. Re: wxWidgets, Dev-C++ and Mac
Posted by: upCASE 2004-04-15 15:37:29
I'd suggest using the XCode IDE (ProjectBuilder in earlier versions). Copy one of the wxWidgets project files to you project folder and adjust the targets and add the new files. Maybe you'll have to set the directories for libs and includes.
It took me a while to figure this out. Check the wxWidgets Wiki, it has some info about that topic.
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: wxWidgets, Dev-C++ and Mac
Posted by: 2004-04-15 19:53:23
ok, i tried with ProjectBuilder and it works well with the wxWidgets samples. But i wanted to know if porting was always easy : doing a app under windows and just compile it under Mac (with ProjectBuilder).

I want to build a graphic app with several windows, dialog boxes, a lot of widgets. And i want to make it with DevCpp under Windows and only compile it under Mac to run on the both plateforms. Is there any constraints ?

Any experiences about that ?
Message4. Re: wxWidgets, Dev-C++ and Mac
Posted by: upCASE 2004-04-15 21:39:26
In general this is how I work, too: Develop on Windows using Dev-C++ and then copy the stuff over to my iMac and compile it there.
To compile I created a project template for wxWidgets apps and simply add the sources to this project. To find out how to create a template was the hardest part, although after all it was really easy (but not documented).

For portability I can say this: If both libs on both systems were compiled the same way, there should be no problems. I mean that if your lib for windows uses database support and your mac lib doesn't, it surely won't work.
In general I didn't have major problems so far. Once there was a problem with eventhandling where a buttons "set focus" event would be generated on the mac while it worked on windows, but I hacked a little solution and now it works.
Be sure to implement the correct menus and don't use stuff like MDI windows. Since Mac apps look very different opposed to windows apps you'll have to care about to little differences.
As I said: In general it should work. Since OS X brought us gcc and a console development is a pretty straight forward process.
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message5. Re: wxWidgets, Dev-C++ and Mac
Posted by: 2004-04-16 14:21:00
I'm working this way, too, and it's ok most of the time.
I created a project folder anywhere on the mac, copied the sources to this place AND copied the "makeprog.env" file from the wxMac/src folder to this project folder.
Last I created a makefile like this in the project folder:

top_srcdir = /wxMac-2.4.2    <- base dir of your wxMac installation
top_builddir = /wxMac-2.4.2  <- depends on the place of your wxMac-builds
program_dir = MyFolder


      inc/abc.o \
      inc/xyz.o \
      wdr/Dialog_Help_wdr.o \
      wdr/Dialog_Settings_wdr.o \
      wdr/Dialog_Start_wdr.o \
      wdr/Dialog_User_wdr.o \

      inc/abc.d \
      inc/xyz.d \
      wdr/Dialog_Help_wdr.d \
      wdr/Dialog_Settings_wdr.d \
      wdr/Dialog_Start_wdr.d \
      wdr/Dialog_User_wdr.d \

-> here a contrib-lib is included for using XML / expat:
include makeprog.env

-include $(DEPFILES)

That's all. Do "make" -> ready for use - in most of the cases ;-)
My project has a main window, several dialogs, static and dynamic controls, changing of language at runtime, about 50 source files at the moment ... The handling is ok, you may do this. As upCase stated it will sometimes have differences to your windows solution, that you should look at manually.

Message6. Re: wxWidgets, Dev-C++ and Mac
Posted by: 2004-04-26 23:07:37
Thank you so much for your help !

i also wanted to ask if you were using Mac OSX or 9. And i would like to use a database : SQLite (under both plateforms). Did you see anywhere some documentation and if it works well.

thank you !
Message7. Re: wxWidgets, Dev-C++ and Mac
Posted by: upCASE 2004-04-29 01:39:15
I used CodeWarrior and 2.4.2 on both OS versions. Currently I'm on OS X. Never tried to work with SQLite on the Mac, but on Windows it worked fine.
With OS X and 2.5.1 you can use the wxODBC classes, because OS X actually has iOdbc under the hood. I think you'd have to use --with-odbc=system when compiling the lib.
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
© Mon 2024-6-17  Guidance Laboratory Inc. Hits:0