LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem in Makefile (https://www.linuxquestions.org/questions/linux-newbie-8/problem-in-makefile-743824/)

bharath285 07-30-2009 01:22 AM

Problem in Makefile
 
Hi,
I am very new to this forum as well as linux. I am using fedora9. Following code is the contents of my Makefile.

CC=g++

all: main

LIBS+=/usr/lib/libQtDBus.so.4

PATH=/opt/qtsdk-2009.02/qt/include/

INCLUDE+=$(PATH)QtDBus \
-I$(PATH)QtCore

main: main.o
$(CC) main.o -o main -L$(LIBS)

main.o: main.cpp
$(CC) -c main.cpp -I$(INCLUDE)

clean:
rm -rf *.o main



And I am getting following error while runnning make.

[bharath@bharath-sys sample]$ make
g++ -c main.cpp -I/opt/qtsdk-2009.02/qt/include/QtDBus -I/opt/qtsdk-2009.02/qt/include/QtCore
make: g++: Command not found
make: *** [main.o] Error 127


Please help me to get out of it.........

Thanks & Regards,
Bharath

Nylex 07-30-2009 02:12 AM

Quote:

Originally Posted by bharath285 (Post 3625028)
[bharath@bharath-sys sample]$ make
g++ -c main.cpp -I/opt/qtsdk-2009.02/qt/include/QtDBus -I/opt/qtsdk-2009.02/qt/include/QtCore
make: g++: Command not found
make: *** [main.o] Error 127


Please help me to get out of it.........

Thanks & Regards,
Bharath

The problem looks obvious: you don't have g++ installed. Have you been able to compile C++ programs before (i.e. have you been able to use g++ on this machine before)? If not, then install g++ using your distribution's package management system (note that other packages will probably have to be installed too). If you need more help, then tell us which distribution you're using and what exactly you need help with.

adityasharma 07-30-2009 02:42 AM

Quote:

Originally Posted by bharath285 (Post 3625028)
Hi,
I am very new to this forum as well as linux. I am using fedora9. Following code is the contents of my Makefile.

CC=g++

all: main

LIBS+=/usr/lib/libQtDBus.so.4

PATH=/opt/qtsdk-2009.02/qt/include/

INCLUDE+=$(PATH)QtDBus \
-I$(PATH)QtCore

main: main.o
$(CC) main.o -o main -L$(LIBS)

main.o: main.cpp
$(CC) -c main.cpp -I$(INCLUDE)

clean:
rm -rf *.o main



And I am getting following error while runnning make.

[bharath@bharath-sys sample]$ make
g++ -c main.cpp -I/opt/qtsdk-2009.02/qt/include/QtDBus -I/opt/qtsdk-2009.02/qt/include/QtCore
make: g++: Command not found
make: *** [main.o] Error 127


Please help me to get out of it.........

Thanks & Regards,
Bharath

hey what Flavour are u using
if u know how to user yum

do yum list |grep gcc*
let us know if it is installed or not
then do a yum install GCC


for this you need to have Yum configured and have the server packages in you machine

bharath285 07-30-2009 02:53 AM

Thanks, I got a soln
 
Problem is not with g++, problem is in declaring INCLUDE.
Now its working.
Thanks for ur reply.


All times are GMT -5. The time now is 07:34 PM.