Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Newbie Problem with the Tutorial
Newbie Problem with the Tutorial [message #77269] Mon, 28 July 2003 13:40 Go to next message
Eclipse UserFriend
Greetings all,

I am attempting to build and run the tutorial in the CDT package on my
Windows 2000 WS. Thus far I have:
1)Installed Eclipse
2)Installed CDT
3)Installed MinGW & MSYS
4) Put the binaries for both MinGW & MSYS in my PATH variable
5) I Cut & Pasted both the Program and the makefile right from the
tutorial as shown below:

------------------------------------------------

#include <iostream>
using namespace std;

int main () {
// Say Hello five times
for (int index = 0; index < 5; ++index)
cout << "HelloWorld!" << endl;

char input = 'i';

cout << "To exit, press ‘m’" << endl;

while(input != 'm') {
cin >> input;
cout << "You just entered " << input
<< " you need to enter m to exit." << endl;
}

exit(0);
}
------------------------------------------------


CXX = gcc <<<Please note; this was NOT in the tutorial but what

CXXFLAGS = -g

all : main.o
${CXX} ${CXXFLAGS} -o hello.exe main.o $@

clean :
rm -rf hello.exe main.o
Newbie Problem with the Tutorial-Continued [message #77286 is a reply to message #77269] Mon, 28 July 2003 13:49 Go to previous messageGo to next message
Eclipse UserFriend
Greetings all,

I am attempting to build and run the tutorial in the CDT package on my
Windows 2000 WS. Thus far I have:
1)Installed Eclipse
2)Installed CDT
3)Installed MinGW & MSYS
4) Put the binaries for both MinGW & MSYS in my PATH variable
5) I Cut & Pasted both the Program and the makefile right from the
tutorial as shown below:

------------------------------------------------

#include <iostream>
using namespace std;

int main () {
// Say Hello five times
for (int index = 0; index < 5; ++index)
cout << "HelloWorld!" << endl;

char input = 'i';

cout << "To exit, press ‘m’" << endl;

while(input != 'm') {
cin >> input;
cout << "You just entered " << input
<< " you need to enter m to exit." << endl;
}
exit(0);
}

------------------------------------------------


CXX = gcc <<<Please note; this was NOT in the tutorial but what
little I remember of make tells me I need this
CXXFLAGS = -g

all : main.o
${CXX} ${CXXFLAGS} -o hello.exe main.o

clean :
rm -rf hello.exe main.o

-------------------------------------------------

Ok, me again. I hope my fat fingers won't accidently post THIS note
before I am ready as they did when I first tried to put in the info.

Anyway, the above program and make file look ok to me but when I rebuild
the project, I get a failure in the make file pointing to the line
invoking the compiler (${CXX} ${CXXFLAGS} -o hello.exe main.o). The error
message says:

"Error *** missing separator. Stop. makefile C++HellowWorld line 5"

I'm stumped...any help will be GREATLY appreciated.

Thanks,

Pete
Re: Newbie Problem with the Tutorial-Continued [message #77319 is a reply to message #77286] Mon, 28 July 2003 14:45 Go to previous messageGo to next message
Eclipse UserFriend
Missing Separator ==> invalid makefile format.
Use tabs rather than spaces as a prefix to a make action.

"Pete Broome" <broome@one.net> wrote in message
news:bg3nn4$tfs$1@eclipse.org...
> Greetings all,
>
> I am attempting to build and run the tutorial in the CDT package on my
> Windows 2000 WS. Thus far I have:
> 1)Installed Eclipse
> 2)Installed CDT
> 3)Installed MinGW & MSYS
> 4) Put the binaries for both MinGW & MSYS in my PATH variable
> 5) I Cut & Pasted both the Program and the makefile right from the
> tutorial as shown below:
>
> ------------------------------------------------
>
> #include <iostream>
> using namespace std;
>
> int main () {
> // Say Hello five times
> for (int index = 0; index < 5; ++index)
> cout << "HelloWorld!" << endl;
>
> char input = 'i';
>
> cout << "To exit, press
Re: Newbie Problem with the Tutorial-Continued [message #77352 is a reply to message #77286] Tue, 29 July 2003 05:40 Go to previous messageGo to next message
Eclipse UserFriend
Pete Broome wrote:

>
> CXX = gcc <<<Please note; this was NOT in the tutorial but what
> little I remember of make tells me I need this

If you write C++, you can also use g++ instead of gcc, since it already has
some settings to its library and their path.
CC = gcc <<< use $(CC) for C-compiles
CXX = g++ <<< use $(CXX) for C++-compiles
RM = rm -f <<< even the delete command is adaptable
> CXXFLAGS = -g
>
> all : main.o
> ${CXX} ${CXXFLAGS} -o hello.exe main.o
^^ <TAB> missing

all: main.o
$(CXX) $(CXXFLAGS) -o hello.exe main.o

>
> clean :
> rm -rf hello.exe main.o
^^ <TAB> missing

clean:
$(RM) hello.exe main.o
Re: Newbie Problem with the Tutorial-Continued [message #77829 is a reply to message #77352] Mon, 04 August 2003 12:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ekrem.ozemail.com.au

Henning Riedel wrote:
> Pete Broome wrote:
>
>
>>CXX = gcc <<<Please note; this was NOT in the tutorial but what
>> little I remember of make tells me I need this
>
>
> If you write C++, you can also use g++ instead of gcc, since it already has
> some settings to its library and their path.
> CC = gcc <<< use $(CC) for C-compiles
> CXX = g++ <<< use $(CXX) for C++-compiles
> RM = rm -f <<< even the delete command is adaptable
>
>>CXXFLAGS = -g
>>
>>all : main.o
>>${CXX} ${CXXFLAGS} -o hello.exe main.o
>
> ^^ <TAB> missing
>
> all: main.o
> $(CXX) $(CXXFLAGS) -o hello.exe main.o
>
>
>>clean :
>>rm -rf hello.exe main.o
>
> ^^ <TAB> missing
>
> clean:
> $(RM) hello.exe main.o
>
>
Thank you Henning.
I was having the exact same problem as Pete Broome and
your post helped me sort that out.

As I'm also a beginner, little things as such aren't always obvious.

Thank you again.
Ekrem
Re: Newbie Problem with the Tutorial-Continued [message #78793 is a reply to message #77829] Thu, 21 August 2003 11:03 Go to previous message
Eclipse UserFriend
Originally posted by: rb200m.doc.ic.ac.uk

ekrem wrote:

> Henning Riedel wrote:
> > Pete Broome wrote:
> >
> >
> >>CXX = gcc <<<Please note; this was NOT in the tutorial but what
> >> little I remember of make tells me I need this
> >
> >
> > If you write C++, you can also use g++ instead of gcc, since it already has
> > some settings to its library and their path.
> > CC = gcc <<< use $(CC) for C-compiles
> > CXX = g++ <<< use $(CXX) for C++-compiles
> > RM = rm -f <<< even the delete command is adaptable
> >
> >>CXXFLAGS = -g
> >>
> >>all : main.o
> >>${CXX} ${CXXFLAGS} -o hello.exe main.o
> >
> > ^^ <TAB> missing
> >
> > all: main.o
> > $(CXX) $(CXXFLAGS) -o hello.exe main.o
> >
> >
> >>clean :
> >>rm -rf hello.exe main.o
> >
> > ^^ <TAB> missing
> >
> > clean:
> > $(RM) hello.exe main.o
> >
> >

Thanx Henning. I was having same problem as well. Big help!. Cheers :)
ali
Previous Topic:Eclipse C#?
Next Topic:remote buuilding
Goto Forum:
  


Current Time: Sun May 11 06:56:22 EDT 2025

Powered by FUDForum. Page generated in 0.05813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top