WxWidgets

Dec 1, 2011 at 2:51pm
Hi

I'm trying to start with wxWidgets (developing under Debian). But I don't understand why I should "install" wxWidgets. Why can't I just include the header-files in my Project and compile it?

Silvan
Dec 1, 2011 at 4:23pm
Because the headers and libraries for WxWidgets do not come with the standard c++ libraries. Installing it allows you to include it.
Last edited on Dec 1, 2011 at 4:23pm
Dec 1, 2011 at 4:30pm
The following is based on the standard practice of headers containing function prototypes only. This is, I believe, the case with wxWidgets.

When you compile code, the compiler looks through the header files to check that the functions you use are being used correctly; it check against the name of the function, the input types, and the return type. The header does not contain the code for the function; only the prototype.

It then leaves a note for the linker, saying "at this point, run the function named THIS, with inputs THESE, and give me back an object of type THIS".

The linker then goes looking for all those functions. They exist in the compiled libraries. No libraries, no compiled code. You have to use the libraries because the headers do not contain the code.
Last edited on Dec 1, 2011 at 4:30pm
Dec 1, 2011 at 5:19pm
As any other library wxWidgets must be compiled. See the /docs subdirectory of the wxWidgets' source distribution.

PS: If you need help with wxWidgets, just tell me !
I use it since so long that I have created my own modified version of wxWidgets.
Dec 1, 2011 at 11:18pm
Thanks a lot!
But after compation, the binary includes all necessary code to talk to the X-Server directly and there aren't any dynamic-linked libraries, are they? So the binary would also run on another linux-machine without having the compiled wxWidgets-files in the inc-directory, wouldn't it? (Like a stand-alone app, constisting of only one binary, talking directly to the X11-Server).
And thanks for your offer Jessy.
Dec 2, 2011 at 7:12am
As long as the machines are compatible (architecture, kernel, OS, etc), yes.
Dec 2, 2011 at 7:17am
If you statically link wxwidgets into your binary, then yes (this is not the default behavior in linux world)
Dec 2, 2011 at 11:38am
Where can I choose the way to link wxWidgets (static/dynamic)? Is this written in the man-page of gcc? Because for little demo-programms I'd like to include it in my binary, but for reel programs it would be better to script an installer which installs the wx-libraries.
Topic archived. No new replies allowed.