macOS Eclipse 4.11.0 code lookup

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
Ishtar
Experienced Solver
Experienced Solver
Posts: 78
Joined: Mon May 20, 2013 6:33 pm

macOS Eclipse 4.11.0 code lookup

Post by Ishtar »

Hi All,

I am primarily a Linux wxWidgets / C++ developer but am currently porting my application to macOS. I have compiled wxWidgets 3.1.2 on macOS High Sierra and have successfully compiled many wxWidgets samples, all of which seem to work very well.

I then moved on to setting up Eclipse 4.11 on macOS and am able to compile simple wxWidgets applications. However, I cannot get code lookup to work. I have done exactly what I usually do when setting up Eclipse on Linux. That is;
  • Added wx-config --cflags to GCC C++ Miscellaneous
  • Added wx-config --libs to GCC C++ Linker Miscellaneous
  • Added /usr/local/wx-mac/include/wx-3.1 to include paths
  • Added /usr/local/wx-macos/lib/wx/include/osx_cocoa-unicode-static-3.1 to include paths
  • Enabled the indexer in the usual way
  • The include paths are correct in C/C++ General / Paths and Symbols
  • Multiple rebuilds of the Eclipse Indexer
Despite doing the above, I still cannot get code lookup to work correctly. It does work for some wxWidgets classes but not for most. For example, wxIMPLEMENT_APP_NO_MAIN(MyApp), myApp::Show() and wxApp::onRun work correctly but code lookup for controls such as wxTextCtrl() and wxButton() don't. Code lookup for other libraries work as expected so this is most likely something to do with my wxWidget setup.

As detailed above, using the exact same procedure works for Eclipse 4.11 on Linux but not for macOS. Does anybody have any idea why I am having this problem.

Many thanks
Amanda
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: macOS Eclipse 4.11.0 code lookup

Post by ONEEYEMAN »

Hi,
Why do you need it?
Are you able to successfully compile the project and create an application bundle?
Is it running successfully?

Remember - the best reference for wxWidgets is the online documentation. ;-)

Thank you.
Ishtar
Experienced Solver
Experienced Solver
Posts: 78
Joined: Mon May 20, 2013 6:33 pm

Re: macOS Eclipse 4.11.0 code lookup

Post by Ishtar »

Thanks Oneeyman,

Well, I suppose I don't need it really but it does help to lookup class methods which can save a lot of time. If I don't get any help then I'll simply disable lookup. Yes, code does compile and runs as expected.

Many thanks
Amanda
Ishtar
Experienced Solver
Experienced Solver
Posts: 78
Joined: Mon May 20, 2013 6:33 pm

Re: macOS Eclipse 4.11.0 code lookup

Post by Ishtar »

For the benefit of anybody else trying to get code completion working on macOS / Eclipse. The solution is to add __WXMAC__ as a Preprocessor declaration. Doing this makes all wxWidgets classes work well.

Regards
Amanda
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: macOS Eclipse 4.11.0 code lookup

Post by ONEEYEMAN »

Hi,
Ishtar wrote: Thu Mar 28, 2019 9:29 pm Hi All,

I am primarily a Linux wxWidgets / C++ developer but am currently porting my application to macOS. I have compiled wxWidgets 3.1.2 on macOS High Sierra and have successfully compiled many wxWidgets samples, all of which seem to work very well.

I then moved on to setting up Eclipse 4.11 on macOS and am able to compile simple wxWidgets applications. However, I cannot get code lookup to work. I have done exactly what I usually do when setting up Eclipse on Linux. That is;
  • Added wx-config --cflags to GCC C++ Miscellaneous
The line above should've been "wx-config --cxxflags"

Sorry about missing it.

The command you put will get the options for C compiler.

Thank you.
Post Reply