Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Error running C++ program
Error running C++ program [message #80038] Thu, 11 September 2003 18:37 Go to next message
Eclipse UserFriend
Originally posted by: webdevil2003.excite.com

Hi All,
I am trying to run HelloWorld project that comes with Tutorials and I am
getting
the following error

ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
Failed

What could be the reason for it?

Thanks
WD
Re: Error running C++ program [message #80087 is a reply to message #80038] Fri, 12 September 2003 14:03 Go to previous messageGo to next message
Eclipse UserFriend
set your binary parser to Windows if you run on Windows
ELF if you run on Linux/Solaris, etc.

"WD" <webdevil2003@excite.com> wrote in message
news:bjqtg7$904$1@eclipse.org...
> Hi All,
> I am trying to run HelloWorld project that comes with Tutorials and I am
> getting
> the following error
>
> ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
> Failed
>
> What could be the reason for it?
>
> Thanks
> WD
>
Re: Error running C++ program [message #80100 is a reply to message #80087] Fri, 12 September 2003 15:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: webdevil2003.excite.com

binary parser is already set to Windows as I am running on Windows.



John Camelon wrote:

> set your binary parser to Windows if you run on Windows
> ELF if you run on Linux/Solaris, etc.

> "WD" <webdevil2003@excite.com> wrote in message
> news:bjqtg7$904$1@eclipse.org...
> > Hi All,
> > I am trying to run HelloWorld project that comes with Tutorials and I am
> > getting
> > the following error
> >
> > ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
> > Failed
> >
> > What could be the reason for it?
> >
> > Thanks
> > WD
> >
Re: Error running C++ program [message #80130 is a reply to message #80100] Sat, 13 September 2003 00:22 Go to previous messageGo to next message
Eclipse UserFriend
WD wrote:

> binary parser is already set to Windows as I am running on Windows.

Could you provide more infos?
* Makefile
* Settings (Debug/Release)
* Toolchain (Cygwin,MinGW))

>Hi All,
>I am trying to run HelloWorld project that comes with Tutorials and I am
>getting
>the following error
>
>ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
>Failed
>
>What could be the reason for it?
Re: Error running C++ program [message #80144 is a reply to message #80130] Sat, 13 September 2003 11:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: webdevil2003.excite.com

I am using the example provided with the tutorials,so the make file is
------
CXXFLAGS = -g

clean :
rm -rf hello.exe main.o

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

I am using MinGW and under Build Settings,Build Command is set to
mingw32-make -f makefile

Do I need to do any other settings?

Thanks
WD


kesselhaus wrote:

> WD wrote:

> > binary parser is already set to Windows as I am running on Windows.

> Could you provide more infos?
> * Makefile
> * Settings (Debug/Release)
> * Toolchain (Cygwin,MinGW))

> >Hi All,
> >I am trying to run HelloWorld project that comes with Tutorials and I am
> >getting
> >the following error
> >
> >ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
> >Failed
> >
> >What could be the reason for it?
Re: Error running C++ program [message #80158 is a reply to message #80144] Sat, 13 September 2003 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Are you really sure, that the project has been build?
I don't know if this is the mistake of you mail-app but the
command-lines are not having tabs in the front. That's why I ask if the
project has been build and the error message has some errors before, you
didn't see.

WD wrote:

> I am using the example provided with the tutorials,so the make file is
> ------
> CXXFLAGS = -g
>
> clean :
> rm -rf hello.exe main.o

<TAB>rm -rf hello.exe main.o
(Must be TAB not spaces!!
>
> all : main.o
> ${CXX} ${CXXFLAGS} -o hello.exe main.o
^^^
Same here

> ------
>
> I am using MinGW and under Build Settings,Build Command is set to
> mingw32-make -f makefile
>
> Do I need to do any other settings?
>
> Thanks
> WD
>
>
> kesselhaus wrote:
>
>
>>WD wrote:
>
>
>>>binary parser is already set to Windows as I am running on Windows.
>
>
>>Could you provide more infos?
>>* Makefile
>>* Settings (Debug/Release)
>>* Toolchain (Cygwin,MinGW))
>
>
>>>Hi All,
>>>I am trying to run HelloWorld project that comes with Tutorials and I am
>>>getting
>>>the following error
>>>
>>>ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
>>>Failed
>>>
>>>What could be the reason for it?
>
>
>
Re: Error running C++ program [message #80189 is a reply to message #80038] Sun, 14 September 2003 19:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rajini_sivan.yahoo.com

Hi WD,
Even i had problems compiling c++ through cdt, the CDT user faq at the
home page is kinda old and i request people responsible to update it with
the following if possible.I had to go through old mails in the newsgroup
to find the way to male it work.
follow these steps:
Open a C/C++ Perspective and complete the following steps:

1)In the C/C++ Projects View right click and select "New Project ..."
2)Select "C++" in the left pane and then select "Standard Make C++ Project"
3)Enter a name for the new project and select Finish. In the "Build
Settings"
remove the default option and type c:\msys\1.0\make -f makefile
4)In the C/C++ Projects View right click and select "New" > "Simple" >
"File". Name your file hello.cpp
Repeat the previous step and name the second new file "makefile".
Copy the following text into the "hello.cpp" file:
#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 " << endl;

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

exit(0);
}



7)Copy the following text into the "makefile" file:
Remember that makefiles require indented lines be a <tab> character and
not spaces


objects = hello.o

LIB_DIR = C:/MinGW/lib/gcc-lib/mingw32/3.2/
BIN_DIR = C:/MinGW/bin/

GCC = $(BIN_DIR)g++


COMPILE_OPTS = -g
CFLAGS = $(COMPILE_OPTS)
ALL_CFLAGS = -I. $(CFLAGS)

#COMPILE_OPTS = -Wno-deprecated

hello : $(objects)
$(GCC) -o hello $(objects) -lstdc++ $(CFLAGS)
# $(GCC) -o hello $(objects) -L $(LIB_DIR) -lstdc++ $(CFLAGS)

$(objects) : hello.cpp
$(GCC) -c hello.cpp $(ALL_CFLAGS)

all : hello

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

9)now right click n the project and choose build.

I dontknow why rebuild doesnt work it gives me a clean error!!!.
And does any person use MinGw's make instead of msys make bcoz, the
program builds fine if i use the build command as c:\msys\1.0\make -f
makefile
but doesnt if i use c:\MinGW\bin\make -f makefile .. why is this
discrepancy?may be its a problem with MinGW???
thanks,
Rajinikanth Sambasivan.

WD wrote:

> Hi All,
> I am trying to run HelloWorld project that comes with Tutorials and I am
> getting
> the following error

> ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
> Failed

> What could be the reason for it?

> Thanks
> WD
Re: Error running C++ program [message #80204 is a reply to message #80189] Sun, 14 September 2003 22:43 Go to previous messageGo to next message
Eclipse UserFriend
Rajinikanth Sambasivan wrote:

> Hi WD,
> Even i had problems compiling c++ through cdt, the CDT user faq at the
> home page is kinda old and i request people responsible to update it with
> the following if possible.I had to go through old mails in the newsgroup
> to find the way to male it work.

Actually, the example works if you follow the steps.
The main thing is to add the C:\MinGW\bin and (if you use MSYS too)
C:\msys\1.0\bin to the path before starting Eclipse.

> follow these steps:
> Open a C/C++ Perspective and complete the following steps:
>
> 1)In the C/C++ Projects View right click and select "New Project ..."
> 2)Select "C++" in the left pane and then select "Standard Make C++ Project"
> 3)Enter a name for the new project and select Finish. In the "Build
> Settings"
> remove the default option and type c:\msys\1.0\make -f makefile

If you set the PATH variable as above, you'll only tell make or
mingw32-make here (see below). Btw. Makefiles start capitalized usually.
If you name your makefiles otherwise, you need to give them by -f option
to make.

> 4)In the C/C++ Projects View right click and select "New" > "Simple" >
> "File". Name your file hello.cpp
> Repeat the previous step and name the second new file "makefile".
> Copy the following text into the "hello.cpp" file:
> #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 " << endl;
>
> while(input != 'm')
> {
> cin >> input;
> cout << "You just entered " << input
> << " you need to enter m to exit." << endl;
> }
>
> exit(0);
> }
>

main method usually only returns with code not exit, but thats usually a
users choice.

>
> 7)Copy the following text into the "makefile" file:
> Remember that makefiles require indented lines be a <tab> character and
> not spaces
>
>
> objects = hello.o
>
> LIB_DIR = C:/MinGW/lib/gcc-lib/mingw32/3.2/
> BIN_DIR = C:/MinGW/bin/

if you use the correct compiler frontend (gcc for C, g++ for C++) you
won't have to explicitly set the library path (it's predefined in the
compiler), though there are aspects for explicitly setting them (i.e.
replacing the standard lib by a customized one).

> GCC = $(BIN_DIR)g++

There is a standard variable for holding compiler in make.
CC - for C Compiler (like gcc)
CXX - for C++ Compiler (like g++)
AS - for Assembler
CFLAGS - for C Compiler flags (includes, debug, warnings...)
CXXFLAGS - for C++ Compiler flags (includes, debug, warnings...)
LDFLAGS - for Linker flags (libs, lib-paths)

>
> COMPILE_OPTS = -g
> CFLAGS = $(COMPILE_OPTS)
> ALL_CFLAGS = -I. $(CFLAGS)
>
> #COMPILE_OPTS = -Wno-deprecated
>
> hello : $(objects)
hello -- is the target here
$(objects) -- are prerequisites

> $(GCC) -o hello $(objects) -lstdc++ $(CFLAGS)

$(CXX) -o $@ $^ $(LDFLAGS)
This is a sufficient line.
$(CXX) -- the compiler as set above or if not set the predefined
-o $@ -- output to the target as declared above
$^ -- the prerequisites as given in the line above
$(LDFLAGS) -- the linker flags as defined above the rules
> # $(GCC) -o hello $(objects) -L $(LIB_DIR) -lstdc++ $(CFLAGS)
>
> $(objects) : hello.cpp
> $(GCC) -c hello.cpp $(ALL_CFLAGS)
>
A more generic rule suites better and is less writing work, like:

%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ $<

It means, create an object file from an cpp file and the % means that
the names before the extensions are the same.
The meaning of the command line is similar to the linker rule above.
The advantage on this more general rules are that you set the CXXFLAGS
and LDFLAGS only once, and you don't have to explicitly add a rule for
each file.
> all : hello
>

Usually the all, debug rules are places before all other rules like the
ones above. The reason is, that if you call make without an specific
target like 'make all' make will take the _first_ rule in the makefile!
That means, make would take the 'hello: $(objects)' rule.

> PHONY : clean
You could add all and debug to the PHONY rule to. Btw. you forgot to put
the '.' in front of the PHONY!

..PHONY: all debug clean

> clean :
> del -f hello.exe $(objects)

you better use a line like

$(RM) $(TARGET) $(OBJECTS)

and add an
RM = rm -f
to the part of the makefile, where CC is set (see above).
One more note below.

>
> 9)now right click n the project and choose build.
>
> I dontknow why rebuild doesnt work it gives me a clean error!!!.

If there is no file in place which should be deleted, then the call
fails. Though you better say

-$(RM) $(TARGET) $(OBJECTS)

Watch the '-' infront of the $(RM). It tells make to ignore errors on
the call. This is useful, if there are no objects to be cleaned.

> And does any person use MinGw's make instead of msys make bcoz, the
> program builds fine if i use the build command as c:\msys\1.0\make -f
> makefile
> but doesnt if i use c:\MinGW\bin\make -f makefile .. why is this
> discrepancy?may be its a problem with MinGW???
> thanks,

The MinGW comes with an mingw32-make.exe within the C:\MinGW\bin
directory. Though you can do two things here if you don't use MSYS!

* Make a copy of mingw32-make.exe to make.exe
* Change the default build command to mingw32-make and add a line in the
makefile at the CC,CXX settings like the following:

MAKE = mingw32-make

This assumes, you have the MinGW bin-dir in your PATH. You can set this
by going on the Desktop, right-click on the 'My Computer', go in the
Popup-Menu to 'Properties'. In the Dialog go to the 'Advanced
Settings'-Tab and click on the Environment Settings Button. Change the
PATH in the bottom list, by adding the MinGW\bin path and if you use
MSYS, the \bin-path too.

Why the MinGW team has named make to mingw32-make, someone told me,
thats because MSYS comes with make too, though there would be a name-clash.

> Rajinikanth Sambasivan.
>
> WD wrote:
>
>
>>Hi All,
>>I am trying to run HelloWorld project that comes with Tutorials and I am
>>getting
>>the following error
>
>
>>ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
>>Failed
>
>
>>What could be the reason for it?
>
>
>>Thanks
>>WD
>
Re: Error running C++ program [message #80218 is a reply to message #80158] Mon, 15 September 2003 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: webdevil2003.excite.com

Yes,the project is getting built. I have hello.exe and main.o generated.
But when I try to run the project,I am getting error

Error starting process : Exec error:Launching Failed

Do I have to do any other setting?
Thanks

WD



kesselhaus wrote:

> Are you really sure, that the project has been build?
> I don't know if this is the mistake of you mail-app but the
> command-lines are not having tabs in the front. That's why I ask if the
> project has been build and the error message has some errors before, you
> didn't see.

> WD wrote:

> > I am using the example provided with the tutorials,so the make file is
> > ------
> > CXXFLAGS = -g
> >
> > clean :
> > rm -rf hello.exe main.o

> <TAB>rm -rf hello.exe main.o
> (Must be TAB not spaces!!
> >
> > all : main.o
> > ${CXX} ${CXXFLAGS} -o hello.exe main.o
> ^^^
> Same here

> > ------
> >
> > I am using MinGW and under Build Settings,Build Command is set to
> > mingw32-make -f makefile
> >
> > Do I need to do any other settings?
> >
> > Thanks
> > WD
> >
> >
> > kesselhaus wrote:
> >
> >
> >>WD wrote:
> >
> >
> >>>binary parser is already set to Windows as I am running on Windows.
> >
> >
> >>Could you provide more infos?
> >>* Makefile
> >>* Settings (Debug/Release)
> >>* Toolchain (Cygwin,MinGW))
> >
> >
> >>>Hi All,
> >>>I am trying to run HelloWorld project that comes with Tutorials and I am
> >>>getting
> >>>the following error
> >>>
> >>>ERROR:Launching HelloWorld : Error starting process : Exec error:Launching
> >>>Failed
> >>>
> >>>What could be the reason for it?
> >
> >
> >
Re: Error running C++ program [message #80233 is a reply to message #80218] Mon, 15 September 2003 14:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: webdevil2003.excite.com

I got it working now.

Thanks
WD



WD wrote:

> Yes,the project is getting built. I have hello.exe and main.o generated.
> But when I try to run the project,I am getting error

> Error starting process : Exec error:Launching Failed

> Do I have to do any other setting?
> Thanks

> WD



> kesselhaus wrote:

> > Are you really sure, that the project has been build?
> > I don't know if this is the mistake of you mail-app but the
> > command-lines are not having tabs in the front. That's why I ask if the
> > project has been build and the error message has some errors before, you
> > didn't see.

> > WD wrote:

> > > I am using the example provided with the tutorials,so the make file is
> > > ------
> > > CXXFLAGS = -g
> > >
> > > clean :
> > > rm -rf hello.exe main.o

> > <TAB>rm -rf hello.exe main.o
> > (Must be TAB not spaces!!
> > >
> > > all : main.o
> > > ${CXX} ${CXXFLAGS} -o hello.exe main.o
> > ^^^
> > Same here

> > > ------
> > >
> > > I am using MinGW and under Build Settings,Build Command is set to
> > > mingw32-make -f makefile
> > >
> > > Do I need to do any other settings?
> > >
> > > Thanks
> > > WD
> > >
> > >
> > > kesselhaus wrote:
> > >
> > >
> > >>WD wrote:
> > >
> > >
> > >>>binary parser is already set to Windows as I am running on Windows.
> > >
> > >
> > >>Could you provide more infos?
> > >>* Makefile
> > >>* Settings (Debug/Release)
> > >>* Toolchain (Cygwin,MinGW))
> > >
> > >
> > >>>Hi All,
> > >>>I am trying to run HelloWorld project that comes with Tutorials and I am
> > >>>getting
> > >>>the following error
> > >>>
> > >>>ERROR:Launching HelloWorld : Error starting process : Exec
error:Launching
> > >>>Failed
> > >>>
> > >>>What could be the reason for it?
> > >
> > >
> > >
Re: Error running C++ program [message #86744 is a reply to message #80189] Sat, 22 November 2003 15:29 Go to previous messageGo to next message
Eclipse UserFriend
I can not find a Build Settings. Where is it.

"Rajinikanth Sambasivan" <rajini_sivan@yahoo.com> wrote in message
news:bk2t13$idh$1@eclipse.org...
> Hi WD,
> Even i had problems compiling c++ through cdt, the CDT user faq at the
> home page is kinda old and i request people responsible to update it with
> the following if possible.I had to go through old mails in the newsgroup
> to find the way to male it work.
> follow these steps:
> Open a C/C++ Perspective and complete the following steps:
>
> 1)In the C/C++ Projects View right click and select "New Project ..."
> 2)Select "C++" in the left pane and then select "Standard Make C++
Project"
> 3)Enter a name for the new project and select Finish. In the "Build
> Settings"
> remove the default option and type c:\msys\1.0\make -f makefile
> 4)In the C/C++ Projects View right click and select "New" > "Simple" >
> "File". Name your file hello.cpp
> Repeat the previous step and name the second new file "makefile".
> Copy the following text into the "hello.cpp" file:
> #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 " << endl;
>
> while(input != 'm')
> {
> cin >> input;
> cout << "You just entered " << input
> << " you need to enter m to exit." << endl;
> }
>
> exit(0);
> }
>
>
>
> 7)Copy the following text into the "makefile" file:
> Remember that makefiles require indented lines be a <tab> character and
> not spaces
>
>
> objects = hello.o
>
> LIB_DIR = C:/MinGW/lib/gcc-lib/mingw32/3.2/
> BIN_DIR = C:/MinGW/bin/
>
> GCC = $(BIN_DIR)g++
>
>
> COMPILE_OPTS = -g
> CFLAGS = $(COMPILE_OPTS)
> ALL_CFLAGS = -I. $(CFLAGS)
>
> #COMPILE_OPTS = -Wno-deprecated
>
> hello : $(objects)
> $(GCC) -o hello $(objects) -lstdc++ $(CFLAGS)
> # $(GCC) -o hello $(objects) -L $(LIB_DIR) -lstdc++ $(CFLAGS)
>
> $(objects) : hello.cpp
> $(GCC) -c hello.cpp $(ALL_CFLAGS)
>
> all : hello
>
> PHONY : clean
> clean :
> del -f hello.exe $(objects)
>
> 9)now right click n the project and choose build.
>
> I dontknow why rebuild doesnt work it gives me a clean error!!!.
> And does any person use MinGw's make instead of msys make bcoz, the
> program builds fine if i use the build command as c:\msys\1.0\make -f
> makefile
> but doesnt if i use c:\MinGW\bin\make -f makefile .. why is this
> discrepancy?may be its a problem with MinGW???
> thanks,
> Rajinikanth Sambasivan.
>
> WD wrote:
>
> > Hi All,
> > I am trying to run HelloWorld project that comes with Tutorials and I am
> > getting
> > the following error
>
> > ERROR:Launching HelloWorld : Error starting process : Exec
error:Launching
> > Failed
>
> > What could be the reason for it?
>
> > Thanks
> > WD
>
>
Re: Error running C++ program [message #86804 is a reply to message #86744] Sun, 23 November 2003 06:43 Go to previous messageGo to next message
Eclipse UserFriend
Right click on your Project, select Properties, there select C/C++ in the
left pane, now its right the first tab on the right pane.

What you could also do is, add C:\MinGW\bin and C:\msys\1.0\bin to
your PATH-variable and restart Eclipse. Eclipse should pickup the new
path-settings and find your make program.

WyleySam schrieb:
> I can not find a Build Settings. Where is it.
>
> ...
Re: Error running C++ program [message #86829 is a reply to message #86804] Sun, 23 November 2003 11:43 Go to previous messageGo to next message
Eclipse UserFriend
Ok, I found it, but what is MinGW??? I downloaded something called Cygwin.
I also downloaded something called gcc-3.3.2.


"Henning Riedel" <kesselhaus@gmx.net> wrote in message
news:bpq2n7$mil$1@eclipse.org...
> Right click on your Project, select Properties, there select C/C++ in the
> left pane, now its right the first tab on the right pane.
>
> What you could also do is, add C:\MinGW\bin and C:\msys\1.0\bin to
> your PATH-variable and restart Eclipse. Eclipse should pickup the new
> path-settings and find your make program.
>
> WyleySam schrieb:
> > I can not find a Build Settings. Where is it.
> >
> > ...
>
Re: Error running C++ program [message #86868 is a reply to message #86829] Sun, 23 November 2003 17:18 Go to previous message
Eclipse UserFriend
Well, I didn't know if you have MinGW or Cygwin, but the PATH thing can
apply to both.
MinGW is another Compiler based also on the GCC Toolchain. The
difference to Cygwin
is, that it links against msvcrt (Microsoft C Runtime) and you wont need
the cygwin.dll
to run your programs.

WyleySam schrieb:
> Ok, I found it, but what is MinGW??? I downloaded something called Cygwin.
> I also downloaded something called gcc-3.3.2.
>
>
> "Henning Riedel" <kesselhaus@gmx.net> wrote in message
> news:bpq2n7$mil$1@eclipse.org...
>
>>Right click on your Project, select Properties, there select C/C++ in the
>>left pane, now its right the first tab on the right pane.
>>
>>What you could also do is, add C:\MinGW\bin and C:\msys\1.0\bin to
>>your PATH-variable and restart Eclipse. Eclipse should pickup the new
>>path-settings and find your make program.
>>
>>WyleySam schrieb:
>>
>>>I can not find a Build Settings. Where is it.
>>>
>>
>> > ...
>>
>
>
>
Previous Topic:Installation Problems
Next Topic:Error in simple HelloWorld App
Goto Forum:
  


Current Time: Thu Jul 17 22:05:07 EDT 2025

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

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

Back to the top