To David - Makefiles of linking wxGTK-2.6.3 Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Knows some wx things
Knows some wx things
Posts: 35
Joined: Mon Feb 21, 2005 12:52 pm

To David - Makefiles of linking wxGTK-2.6.3

Post by vsp » Mon Apr 24, 2006 6:37 am

hi David thanks for ur reply i have given my Makefile here with this post so help me out in the proper linkiing of wxGTK2.6.3. i have given two makefiles one is local Makefile named Makefile.linux and another one is master makefile which is named as Makefile.


OUTPUT = xxx

WXLIBS = -lwx_gtk2_core-2.6 -lwx_gtk2_adv-2.6 -lwx_gtk2_gl-2.6 -lwx_base_net-2
.6 -lwx_base-2.6

GTKLIBS = -Wl,--export-dynamic -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -l
gdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodu
le-2.0 -ldl -lgthread-2.0 -lglib-2.0 -lpng -lz -ljpeg -ltiff
SYSLIBS = -lm -lz -ldl
FLEXLIBS = -llmgr -lsb -lcrvs -llmgr_as -llmgr_s -lsb_pic

PARENTOBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
DESIGNOBJS := $(patsubst ./Parameter/%.cpp,./Parameter/%.o,$(wil
dcard ./Parameter/*.cpp))

CC = c++
LD = c++

-I.. \
lease-2.6 \

-L/usr/include/gtk-2.0 \
-L/usr/lib64/gtk-2.0/include \
-L/usr/include/glib-2.0 \
-L/usr/lib64/glib-2.0/include \
-L/usr/include/pango-1.0 \
-L/usr/include/atk-1.0 \
-L/home/downloads/testwx2.6.3/wxGTK-2.6.3/lib \

Makefile - (Master Makefile)


@echo ================================
@echo Building $(OUTPUT) ...
$(LD) $(LIBPATH) $(LINKFLAGS) -o [email protected] $(OBJS) $(FLEXOBJ) $(LIBS)
@echo ================================
@echo Copying libraries...
@mkdir -p LIB 2>/dev/null

.SUFFIXES: .o .cpp .c
@echo "------------------------------" >> errors
@echo $< >> errors
@echo $<
@$(CC) $(INCPATH) $(CCFLAGS) $< -o [email protected]

@echo ================================
@echo Cleaning...
/bin/rm -f .depend $(OBJS) $(OUTPUT)

In need of some credit
In need of some credit
Posts: 1
Joined: Mon Apr 24, 2006 8:54 am

Post by fenny » Mon Apr 24, 2006 9:54 am

I think the problem is your sequence of the linked libs. They are relative.The lib based by other libs must be placed at the back.
wx_gtk2_adv-2.6 should be placed in front of wx_gtk2_core-2.6
You can refer to the chapter of libraries list in wxWidgets manual,
there are relation of the libs.

ps: I am chinese,so my English is poor. Maybe I didnot express clearly.If that, I feel sorry!

wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte » Mon Apr 24, 2006 10:04 am

vsp, could you please respond to your initial message instead of creating new threads.

It becomes quite difficult to help you when all your messages are dispatched in several categories (C++ development, Compiler / Linking / IDE Related, Platforms Related Issues).

Site Admin
Site Admin
Posts: 4006
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Mon Apr 24, 2006 10:31 am


Thank you for posting your makefile(s). I was about to say the same thing as fenny: the order could be the problem. FWIW, my order is xrc, xml, adv, core, base. (You won't necessarily need the extra ones.)

If that doesn't work, try adding any other libraries that your build created.

One other thing. Is this the first time you've installed wxGTK-2.6.x on this partition? If not, you could be getting conflicts with previous libraries. One answer to this would be to do a local install: see



Post Reply