How to build wxWidgets projects with Eclipse 2019.12 on Linux? [CDT-Project]

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
var_null
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Feb 27, 2020 6:44 pm

How to build wxWidgets projects with Eclipse 2019.12 on Linux? [CDT-Project]

Post by var_null »

I already installed wxWidgets following these instructions: https://wiki.codelite.org/pmwiki.php/Ma ... aries#toc2

Added "/usr/include/wx-3.1-unofficial/" under "Project Properties--> C/C++ Build--> Settings--> Cross GCC Compiler--> Includes" and "Project Properties--> C/C++ Build--> Settings--> Cross G++ Compiler--> Includes"

However I'm missing something, since when I try to build my project I get the following error:

Code: Select all

/usr/include/wx-3.1-unofficial/wx/platform.h:154:10: fatal error: wx/setup.h: No such file or directory
What path am I missing?

Thanks!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7480
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to build wxWidgets projects with Eclipse 2019.12 on Linux? [CDT-Project]

Post by ONEEYEMAN »

Hi,
You are missing an include folder where the "setup.h" is located.
The best way to see it is to try and build minimal sample and check what options is used when building it. Then try to mimic those options inside Eclipse.

Thank you.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: How to build wxWidgets projects with Eclipse 2019.12 on Linux? [CDT-Project]

Post by DavidHart »

Hi,

The most likely reason is that you aren't using the wx-config script, or aren't using it properly.

To build a (Linux) wx project on the command-line, you'd do something like:
g++ foo.cpp bar.cpp $(wx-config --cxxflags --libs) -o baz

I don't use Eclipse, but it will have a compilation settings field somewhere; that should include something like
$(wx-config --cxxflags)
though the exact syntax will vary between IDEs. Similarly for the linker field:
$(wx-config --libs)

Regards,

David
var_null
Earned a small fee
Earned a small fee
Posts: 14
Joined: Thu Feb 27, 2020 6:44 pm

Re: How to build wxWidgets projects with Eclipse 2019.12 on Linux? [CDT-Project]

Post by var_null »

Thanks to both of you for your replies
Post Reply