installing wxWidgets under linux: setup.h is a problem...

Evan Charlton usenet at evancharlton.com
Tue Oct 30 08:47:34 PDT 2007


Marc wrote:
> On 29 oct, 19:39, Evan Charlton <use... at evancharlton.com> wrote:
>> Marc wrote:
>>> On 29 oct, 16:05, Evan Charlton <use... at evancharlton.com> wrote:
>>>> Marc wrote:
>>>>> Hi,
>>>>> I am rather new... I finally managed to get kdevelop working, and I
>>>>> installed wxWidgets in two ways :
>>>>> 1) locally by compiling it, and now my wx-config --prefix is /home/
>>>>> bletry/wxWidgets/ (it is the wxX11 version)
>>>>> 2) wxGTK via rpm (using yum).
>>>>> Under kdevelop I created their "hello world" wxWidgets which first
>>>>> could not find wx/wx.h, which I solved by a ln -s  wx-2.6/wx wx, but
>>>>> now it tells me :
>>>>> /usr/include/wx/platform.h:190:22: wx/setup.h : No such file or
>>>>> directory.
>>>>> Apparently, platform.h wants to find a setup.h that is not included in
>>>>> the rpm, but should come when compiling the library... ? there, I am
>>>>> lost. Could anyone help, please ? I am rather new to linux world...
>>>>> Thanks a lot !!
>>>>> Marc
>>>> I've never tried setting up two different builds (wxX11 and wxGTK) of
>>>> wx, but my process for building on Linux is as follows:
>>>> 1. Download and extract the source (we'll say it's in ~/wxGTK-2.8.6/ for
>>>> now)
>>>> 2. `cd ~/wxGTK-2.8.6/`
>>>> 3. `mkdir build-static` # I'll be building a statically-linked Unicode
>>>> build for this example
>>>> 4. `cd build-static/`
>>>> 5. `../configure --prefix=/usr/local --disable-shared --enable-unicode`
>>>> 6. `make`
>>>> 7. `sudo make install`
>>>> And KDevelop works and builds fine. I'm not saying this is the best way,
>>>> but it works for me. (anyone see any obvious flaws?)
>>>> Evan Charlton
>>> Thanks for your answer :)
>>> I cannot use RPM version ? yum had the good idea to find
>>> something... ? But does not this allow one to avoid the compiling
>>> step ?
>> You could use yum but then you are limited to their build configuration
>> (you cannot choose options such as static/dynamic linking, unicode,
>> etc). That's why I choose to build from source (it only takes a few
>> minutes on a 1.8 Core 2 Duo machine).
> 
> Hi Evan,
> 
> I tried your way, and it works fine !!! Thank you so much !! :):):):)
> If you have a little time, how should I do to compile a second version
> - let's say a dynamic one, and switch between static and dynamic ?
> Once again, thank you so much !!
> 
> Marc
> 

Glad to hear it worked out for you! To compile a dynamic configuration, 
I believe the process would be something like:
1. `cd ~/wxGTK-2.8.6/`
2. `mkdir build-dynamic`
3. `cd build-dynamic/`
4. `../configure --prefix=/usr/local --enable-shared --enable-unicode`
5. `make`
6. `sudo make install`

Then to switch, you would need to use `wx-config --static[=yes|no] [..]` 
in your compile command. See `wx-config --help` for more information.

Evan Charlton






More information about the wx-users mailing list