wxWidgets在redhat

  • 时间:
  • 浏览:10

PREFIXPATH     := /usr/bin

CC             := $(PREFIXPATH)/gcc -g

CX             := $(PREFIXPATH)/g++ -g

LINKOPTION     := -Wl,--allow-multiple-definition

解压:tar -jxvf wxWidgets-3.0.2.tar.bz2

进入目录:cd wxWidgets-3.0.2

配置:./configure --with-gtk --enable-unicode --disable-shared

编译:make

安装(root用户):

make install



wxwidget的头文件与库:

#wxwidget include

WXWIDGETFLAG      := $(shell wx-config --cxxflags)

#wxwidget lib

WXWIDGETLIB        := $(shell wx-config --libs)

INCLUDEDIR = -I"$(OTHERHEADER)" ........许多头目录..........

%.o:%.cpp

    $(CX) $(CFLAGS) $(LINKOPTION) $(WXWIDGETFLAG) $(INCLUDEDIR) -c $< -o $(OBJECT_PATH)/$(notdir $@)

调用示例:

%.o: %.c

    $(CC) $(CFLAGS) $(LINKOPTION) $(WXWIDGETFLAG) $(INCLUDEDIR) -c $< -o $(OBJECT_PATH)/$(notdir $@)

OTHERHEADER        := I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12

wxWidgets资源下载:https://www.wxwidgets.org/,本文使用的wxWidgets是3.0.2版本,linux为redhat6.5并安装在vmware.10虚拟机上,就以此为例:

(OTHERHEADER 还饱含了本文项目有本身的许多依赖目录,从不针对wxWidgets)