Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How to compile and install wxWidgets in Ubuntu / Debian / Linux Mint     - Django Signals from practice to source code analysis (Programming)

- Debian (Wheezy) Install Java environment / replace OpenJDK as the SUN JDK (Linux)

- Job achieve automation in Ubuntu 14.04 - Using Cron (Linux)

- MySQL tmpdir parameter modification (Database)

- You know the difference between URL, URI and URN among you (Linux)

- MySQL5.7 JSON type using presentation (Database)

- ogg start being given libnnz11.so: can not open shared object file (Database)

- CentOS / RHEL 6 was repeated prohibited under the SNMP connection log (Server)

- secureCRT remote login Linux must first open the connection protocol (Linux)

- Linux common network tools: Scan routing of mtr (Linux)

- Export error: ORA-04063: package body dmsys dbms dm model exp has error (Database)

- How Linux system password security guarantee (Linux)

- Zabbix monitors the status of TCP connections (Server)

- CentOS 6.5 platform offline compile and install PHP5.6.6 (Server)

- Fedora 22 Server how to upgrade to Fedora 23 Beta Server (Linux)

- Cacti installation deployment under CentOS 6.6 (Server)

- KVM add virtual disks (Linux)

- CentOS7 installation configuration Redis-3.0.0 (Database)

- Docker ecosystem security is gradually maturing (Server)

- Linux environment MySQL master-slave synchronization (Database)

  How to compile and install wxWidgets in Ubuntu / Debian / Linux Mint
  Add Date : 2018-11-21      

wxWidgets is a development framework / library that allows you to use the same code cross-platform development on Windows, Mac, Linux in. It is mainly written in C ++, but can also bind such as Python, Perl, Ruby and other languages.

For this tutorial I will show you how to like Ubuntu and Linux Mint compiled wxwidgets 3.0+ in Debian based linux box.

WxWidgets from source compiler is not difficult, just take a few minutes. Library can be compiled in different ways, such as static or dynamic libraries.

1. Download wxWidgets

The first step you need to download the source files from wxWidgets wxwidgets.org.

After the finish, extract to a directory.

2. Set the build environment

To compile wxwidgets, we need some tools include a C ++ compiler on Linux g ++. All of these tools can be installed via apt-get from the warehouse.

We also need to rely on wxWidgets GTK development library.

$ Sudo apt-get install libgtk-3-dev build-essential checkinstall
This is called checkinstall tool allows us to create an installation package for wxwidgets, so then you can easily use the package manager to uninstall.

3. Compile wxWidgets

WxWidgets into the directory after decompression. To clean, use a compiler to create the directory.

$ Mkdir gtk-build
$ Cd gtk-build /
Now run configure and make commands. Each will take some time to complete.

$ ../configure --disable-Shared --enable-unicode
$ Make
"--disable-Shared" option will compile a static library instead of dynamic libraries.

After the make command completes, the compiler will be successful. It is time to install wxWidgets to the correct directory.

For more information see install.txt and readme.txt, which can be found at wxwidgets in the / docs / gtk / directory.

4. Install checkinstall

Now we do not use "make install" command, we use the checkinstall command to create a wxwidgets the deb package. Run the command:

$ Sudo checkinstall
checkinstall will ask a few questions, please ensure that after questioning a version number, otherwise it will fail.

After the completion of all this, wxWidgets is now installed, deb file will be created in the same directory.

5. Tracking installed files

If you want to check the location of the installation file, using dpkg command followed by the package name checkinstall provided.

$ Dpkg -L package_name
/ Usr
/ Usr / local
/ Usr / local / lib

6. Compiling the Sample

After compiling wxWidgets can compile immediately complete sample program. In the same directory, a new sample catalog has been created.

Enter it and run the following command

$ Compile samples
$ Cd samples /
$ Make
After the make command completes, enter the sample subdirectory, where there is a running immediately Demo program.

7. Compile your first program

After you have completed compilation demo program, you can write your own program to compile. This is also very simple.

Suppose you are using C ++, so you can also use the editor's highlight features. For example, gedit, kate, kwrite like. Or use the full-featured IDE such as Geany, Codelite, Codeblocks like.

However, your first program just use a text editor to quickly complete.

as follows:

classSimple: public wxFrame
Simple (const wxString & title)
: WxFrame (NULL, wxID_ANY, title, wxDefaultPosition, wxSize (250,150))
Centre ();
classMyApp: public wxApp
boolOnInit ()
Simple * simple = newSimple (wxT ( "Simple"));
simple-> Show (true);
Now save and compile with the following command.

# Compile
$ G ++ basic.cpp `wx-config --cxxflags --libs std`-o program
# Run
$ ./program

And non-standard libraries compiled together

Surface display wx-config command by default only supports the standard library. If you are using Aui library, then you need to specify the additional use of the library.

$ G ++ code.cpp `wx-config --cxxflags --libs std, aui`-o program
- ctop: monitor container performance Linux command line artifact (Linux)
- Circular list of Java programming (Programming)
- Optimized to minimize the installation of CentOS 5.8 (Linux)
- Local port forwarding using iptables under linux (Server)
- Linux systems dmesg command processing failures and system information collected seven usage (Linux)
- Elaborate .NET Multithreading: Using Task (Programming)
- Python Socket Network Programming (Programming)
- CentOS iptables firewall configuration (Linux)
- I use the desktop environment in GNU / Linux combination tool (Linux)
- SHELL script to use anti SSH brute force and vsftpd (Linux)
- Linux security settings (Linux)
- Compile and install LNMP under CentOS 6.5 (Server)
- How Datadog monitor Nginx (Server)
- Iptables application layer plug (Linux)
- About DataGuard three protected mode test (Database)
- DIY security of Linux platform (Linux)
- CentOS yum source as the default setting methods in DVD (Linux)
- Oracle Database Delete Delete million or more common method of heap table data (Database)
- Analyzing Linux server architecture is 32-bit / 64-bit (Server)
- Java heap (Heap) and stack difference (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.