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
vsp
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.

Makefile.linux

OUTPUT = xxx

APPLIBS =
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
DISPLIBS = -lGLU -lGL
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))


OBJS = $(PARENTOBJS) $(DESIGNOBJS)
CC = c++
LD = c++
CCFLAGS = -O2 -fcheck-new -DLINUX -D__WXGTK__ -DGTK_NO_CHECK_CASTS -c -DGNU
LINKFLAGS = -m64
LIBS = $(APPLIBS) $(WXLIBS) $(GTKLIBS) $(SYSLIBS) $(DISPLIBS)

INCPATH = -I. \
-I.. \
-I/home/downloads/testwx2.6.3/wxGTK-2.6.3/lib/wx/include/gtk2-ansi-re
lease-2.6 \
-I/home/downloads/testwx2.6.3/wxGTK-2.6.3/include

LIBPATH = -L../LIB \
-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 \
-L/usr/XllR6/lib64

Makefile - (Master Makefile)

include $(PLATFORM_MODULE_MAKEFILE)

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

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


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

fenny
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.
e.g
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!

benedicte
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).

DavidHart
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

Hi,

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 http://forums.wxwidgets.org/viewtopic.php?t=7065.

Regards,

David

Post Reply