[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    MAKEFILE
From:       Eric Halim <pramudya81 () yahoo ! com>
Date:       2002-12-03 9:58:18
[Download RAW message or body]

Hi,

I'm creating makefile.lnx for my app(C++ QT Designer).
This what I did:
(I found this resource from QT Designer doc)

C_FLAGS = -O6

CC = g++

all: football

football: Football.o moc_Football.o Main.o
	  $(CC) -o $@ $+ -L$(QTDIR)/lib -lqt
-L$(AMZI_DIR)/lib $(C_FLAGS) -lamzi -lm -lstdc++


Football.o:     Football.cpp Football.h LS.h Splash.h
	        $(CC) -c $< -I$(QTDIR)/include
-I$(AMZI_DIR)/include

moc_Football.o: moc_Football.cpp Football.h
	        $(CC) -c $< -I$(QTDIR)/include
(I changed $$< to $< since $$< makes a syntax error)

Main.o:         Main.cpp Football.h
	        $(CC) -c $< -I$(QTDIR)/include


moc_Football.cpp : Football.h
	           moc -o $@ $<
Note: I included (AMZI_DIR) since I use this software.

It compiles fine but when I quit the app the seg fault
occurs and some critical functions of my app such as
loading database cant work.

When I did this:
FILES = Football.cpp moc_Football.cpp Main.cpp

C_FLAGS = -O6

CC = g++

all: football

football: $(FILES)
	  $(CC) -I$(QTDIR)/include $(FILES) -L$(QTDIR)/lib
-lqt -I$(AMZI_DIR)/include -L$(AMZI_DIR)/lib
$(C_FLAGS) -lamzi -lm -lstdc++

This works perfectly. However, this makes no sense
since compiling and linking all in 1 process. I mean
if I use the first case it would be much easier for
testing and debugging purpose.

What's the mistake?



Regards
eric



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic