wxWidgets 3.0

To add the repository, first import the key:

sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
 

Then add the source:


sudo tee /etc/apt/sources.list.d/wxwidgets.list
deb http://repos.codelite.org/wx3.0.2/ubuntu/ $(lsb_release -sc) universe
sudo apt-get update

Install wxWidgets modules:


sudo apt-get install libwxbase3.0-0-unofficial libwxbase3.0-dbg libwxbase3.0-dev libwxgtk3.0-0-unofficial libwxgtk3.0-dbg wx3.0-doc wx3.0-examples

Create soft-link:

sudo ln -s /usr/include/wx-3.0-unofficial/wx /usr/include/wx 

To compile a single file, create a script named wxcompile and edit it with the content as below (assume with have subdirectory obj/Debug and bin/Debug:


#!/bin/bash

if [ -z "${1}" ]
then
echo "$0 "
exit 1
fi

FILE=`basename $1`
CPPF=$FILE
OBJF=`basename -s .cpp $CPPF`
OBJF=${OBJF}.o
g++ -g -c -Wall -DWX_PRECOMP -Winvalid-pch `wx-config --cppflags` -o obj/Debug/${OBJF} ${CPPF}

To link, create a script file name ‘wxlink’ and its content as below:


#!/bin/bash

if [ -z "${1}" ]
then
echo "$0 "
exit 1
fi

FOUT=$1
OBJF=obj/Debug/*.o

g++ -v obj/Debug/*.o `wx-config --libs` -o obj/Debug/$FOUT

For a bigger project which requires more complicated and conditional compilation, use Makefile.

Advertisements

About The Seeker

Silicon Valley
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s