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 » Fri Feb 28, 2020 5:09 pm

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: 3893
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 » Fri Feb 28, 2020 7:44 pm

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: 3940
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 » Fri Feb 28, 2020 7:53 pm

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 » Sun Mar 15, 2020 5:11 pm

Thanks to both of you for your replies

Post Reply