Deriving from a sample

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
In need of some credit
In need of some credit
Posts: 9
Joined: Mon May 16, 2016 1:09 pm

Deriving from a sample

Post by undertone_dj » Sun May 22, 2016 12:05 pm

I'm just starting out in wxWidgets, and I've got it compiling, and the samples running.

Xcode 7.1
SDK 10.6 added

When I copy the sampes/minimal folder to another location on my hard drive to derive from it and start a new project (maybe that's not the way to go about this? Making a new xcodeproj, and adding wxWidgets source might be the more proper way?)... when I compile, I get 11 errors immediately.

/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:20:10: 'wx/wxprec.h' file not found
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:47:22: Expected class name
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:56:26: Expected ';' at end of declaration list
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:60:24: Unknown class name 'wxFrame'; did you mean 'MyFrame'?
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:60:24: Base class has incomplete type
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:64:19: Unknown type name 'wxString'
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:67:17: Unknown type name 'wxCommandEvent'
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:68:18: Unknown type name 'wxCommandEvent'
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:72:5: C++ requires a type specifier for all declarations
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:83:20: Use of undeclared identifier 'wxID_EXIT'
/Users/dj/Documents/projects/training/wxWidgets/minimal/minimal.cpp:88:21: Use of undeclared identifier 'wxID_ABOUT'

I suspect I need some header
~/Downloads/wxWidgets-3.1.0/include/wx (non-recursive)
~/Downloads/wxWidgets-3.1.0/include/wx/osx (recursive)

Most of the errors go away when I do that. Except:

I tried adding a slash to the end of my header search paths, thinking that it may not be considering those folders:

didn't help.

I use spotlight to discover where this missing file is. 9 hits.


I would think that I should be error free now. I would assume that :
~/Downloads/wxWidgets-3.1.0/include/wx/ which I have in my header search paths would be catching the wxprec.h file that is there

noticing that the error has wx/ built into the path at that line... I see that I need to be one folder up. so I add this to my header search paths:

The error goes away, but I get a new error:
/Users/dj/Downloads/wxWidgets-3.1.0/include/wx/platform.h:136:10: 'wx/setup.h' file not found

I've got another two threads hunting down other approaches that are landing at this same issue:

Here's another thread on the same error, but it's Linux specific....

Any advice?

Post Reply