Problems about compiling c++ standard make project in eclips

I installed the cdt in the eclipse.So now I can process the c++ file.I
programeded a simple c++ file:hello world! And I programed a make file .This
is the code:

objects = hello.o

hello : $(objects)
gcc -o hello $(objects) -L /usr/bin
$(objects) : hello.cpp
gcc -c hello.cpp

all :
${MAKE} hello

…PHONY : clean
clean :
-del hello.exe $(objects)

I use the command : /usr/bin/make -f makefile to compile the makefile.

But there is a error :***commands commence before first target.Stop.
How to solve the problem? Help!

Colin Burgess <cburgess@qnx.com> wrote:
CB > make is very picky about the use of tabs, eg

CB > hello : $(objects)
CB > gcc -o hello $(objects) -L /usr/bin
CB > ^
CB > there MUST be a tab character here.

I.E. Not Spaces!

make is very picky about the use of tabs, eg

hello : $(objects)
gcc -o hello $(objects) -L /usr/bin
^
there MUST be a tab character here.

du yuqiang <power_du@163.net> wrote:

I installed the cdt in the eclipse.So now I can process the c++ file.I
programeded a simple c++ file:hello world! And I programed a make file .This
is the code:

objects = hello.o

hello : $(objects)
gcc -o hello $(objects) -L /usr/bin
$(objects) : hello.cpp
gcc -c hello.cpp

all :
${MAKE} hello

.PHONY : clean
clean :
-del hello.exe $(objects)

I use the command : /usr/bin/make -f makefile to compile the makefile.

But there is a error :***commands commence before first target.Stop.
How to solve the problem? Help!




cburgess@qnx.com

du yuqiang <power_du@163.net> wrote:
: I installed the cdt in the eclipse.So now I can process the c++ file.I
: programeded a simple c++ file:hello world! And I programed a make file .This
: is the code:

: objects = hello.o

: hello : $(objects)
: gcc -o hello $(objects) -L /usr/bin
: $(objects) : hello.cpp
: gcc -c hello.cpp

: all :
: ${MAKE} hello

: .PHONY : clean
: clean :
: -del hello.exe $(objects)

: I use the command : /usr/bin/make -f makefile to compile the makefile.

: But there is a error :***commands commence before first target.Stop.
: How to solve the problem? Help!

You should have “-g” if you want to debug.
And has the other posters noted.

My two cents:

-del hello.exe - this is wrong, should be hello.
-L /usr/bin doesn’t make sense - there are neither .so nor .a libraries in
/usr/bin.

“du yuqiang” <power_du@163.net> wrote in message
news:bik6n6$jls$1@inn.qnx.com

I installed the cdt in the eclipse.So now I can process the c++ file.I
programeded a simple c++ file:hello world! And I programed a make file
…This
is the code:

objects = hello.o

hello : $(objects)
gcc -o hello $(objects) -L /usr/bin
$(objects) : hello.cpp
gcc -c hello.cpp

all :
${MAKE} hello

.PHONY : clean
clean :
-del hello.exe $(objects)

I use the command : /usr/bin/make -f makefile to compile the makefile.

But there is a error :***commands commence before first target.Stop.
How to solve the problem? Help!
\