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
undertone_dj
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
WxWidgets-3.0.1

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:
wx/wxprec.h


I tried adding a slash to the end of my header search paths, thinking that it may not be considering those folders:
~/Downloads/wxWidgets-3.1.0/include/wx/
~/Downloads/wxWidgets-3.1.0/include/wx/osx/

didn't help.

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

usr/local/include/wx-3.1/wx/
/Users/dj/Downloads/wxWidgets-3.1.0/include/wx
/Users/dj/Documents/projects/training/audacity/audacity_playground/audacity-master/src/wx
usr/local/include/wx-3.1/wx
/Users/dj/Downloads/wxWidgets-3.1.0/include/wx
/Users/dj/Documents/projects/training/wxWidgets/wxWidgets_hello_world/wxWidgets_hello_world/wx
/Users/dj/Documents/projects/training/wxWidgets/wxWidgets_hello_world/wxWidgets_hello_world/include/wx
usr/local/include/wx-3.0-release/wx
usr/local/include/wx-3.0-debug/wx

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:
~/Downloads/wxWidgets-3.1.0/include/

The error goes away, but I get a new error:
platform.h
/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:
viewtopic.php?f=19&t=42241
viewtopic.php?f=19&t=42239

Here's another thread on the same error, but it's Linux specific....
viewtopic.php?f=19&t=42264

Any advice?

Post Reply