473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

C++ code wont execute under Linux.

I type ./a.out and the shell just sits there. It doesnt hang it just
sits there looking pretty.

I run the program with the ddd option and executed it from
ddd...execution window comes up and nothing shows up.
I used anjuta same thing. No compiler errors no warnings but it wont
execute.
Checked the permisions of the file and its execute..tried with no
execute from desperation,....same shit.
And yeah i got make.

WTF is missing?

As I said, during compile, NO ERRORS and NO WARNINGS. I demoted my
self to a simple hello world program just to keep things simple
Jul 19 '05 #1
11 4880

penguinman <ba******@linuxmail.org> wrote in message
news:96**************************@posting.google.c om...
I type ./a.out and the shell just sits there. It doesnt hang it just
sits there looking pretty.

I run the program with the ddd option and executed it from
ddd...execution window comes up and nothing shows up.
I used anjuta same thing. No compiler errors no warnings but it wont
execute.
Checked the permisions of the file and its execute..tried with no
execute from desperation,....same shit.
And yeah i got make.

WTF is missing?

As I said, during compile, NO ERRORS and NO WARNINGS. I demoted my
self to a simple hello world program just to keep things simple


You have a bug on line 37.

-Mike

Jul 19 '05 #2

"penguinman" <ba******@linuxmail.org> wrote in message
news:96**************************@posting.google.c om...
I type ./a.out and the shell just sits there. It doesnt hang it just
sits there looking pretty.

I run the program with the ddd option and executed it from
ddd...execution window comes up and nothing shows up.
I used anjuta same thing. No compiler errors no warnings but it wont
execute.
Checked the permisions of the file and its execute..tried with no
execute from desperation,....same shit.
And yeah i got make.

WTF is missing?

As I said, during compile, NO ERRORS and NO WARNINGS. I demoted my
self to a simple hello world program just to keep things simple


So why haven't you posted the code? How are we supposed to know what might
be wrong with nothing to go by? If it's Linux help or compiler help you
need, then ask in a newsgroup dedicated to those topics. We help with C++
problems here, and you've not posted any C++ code to look at.

-Howard
Jul 19 '05 #3
"penguinman" <ba******@linuxmail.org> wrote...
[...]

WTF is missing?

As I said, during compile, NO ERRORS and NO WARNINGS. I demoted my
self to a simple hello world program just to keep things simple


This is FAQ 5.8

Victor
Jul 19 '05 #4

"penguinman" <ba******@linuxmail.org> wrote in message
news:96**************************@posting.google.c om...
I type ./a.out and the shell just sits there. It doesnt hang it just
sits there looking pretty.

I run the program with the ddd option and executed it from
ddd...execution window comes up and nothing shows up.
I used anjuta same thing. No compiler errors no warnings but it wont
execute.
Checked the permisions of the file and its execute..tried with no
execute from desperation,....same shit.
And yeah i got make.

WTF is missing?

As I said, during compile, NO ERRORS and NO WARNINGS. I demoted my
self to a simple hello world program just to keep things simple


Are you flushing the output stream? Try the following (in the absence of any
posted code on your part):

#include <iostream>
int main()
{
std::cout << "hello, world" << std::flush;
}


Jul 19 '05 #5
Bob Jacobs wrote:


Are you flushing the output stream? Try the following (in the absence of any
posted code on your part):

#include <iostream>
int main()
{
std::cout << "hello, world" << std::flush;
}


That's not good enough. First, cout will be flushed automatically when
it is destroyed (I think).

Second, flushing alone does not guarantee the text is displayed. Only
*lines* are guaranteed to be displayed. If your output doesn't end with
a newline, bad things can happen. One thing that's likely is that the
system prompt will overwrite your last line of text.

Better change that std::flush to std::endl, or else add a '\n'.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #6
"Bob Jacobs" <ne****@robertjacobs.fsnet.co.uk> wrote in message news:<bj**********@newsg4.svr.pol.co.uk>...
"penguinman" <ba******@linuxmail.org> wrote in message
news:96**************************@posting.google.c om...
I type ./a.out and the shell just sits there. It doesnt hang it just
sits there looking pretty.

I run the program with the ddd option and executed it from
ddd...execution window comes up and nothing shows up.
I used anjuta same thing. No compiler errors no warnings but it wont
execute.
Checked the permisions of the file and its execute..tried with no
execute from desperation,....same shit.
And yeah i got make.

WTF is missing?

As I said, during compile, NO ERRORS and NO WARNINGS. I demoted my
self to a simple hello world program just to keep things simple


Are you flushing the output stream? Try the following (in the absence of any
posted code on your part):

#include <iostream>
int main()
{
std::cout << "hello, world" << std::flush;
}


Yes and its a no go still...:( no errors no warning everything goes
well besides the execution part :(
Jul 19 '05 #7
penguinman wrote:
"Bob Jacobs" <ne****@robertjacobs.fsnet.co.uk> wrote in message news:<bj**********@newsg4.svr.pol.co.uk>...

Are you flushing the output stream? Try the following (in the absence of any
posted code on your part):

#include <iostream>
int main()
{
std::cout << "hello, world" << std::flush;
}

Yes and its a no go still...:( no errors no warning everything goes
well besides the execution part :(


If that's still the case after replacing std::flush with std::endl, then
you should ask your question on a group that supports your particular
compiler. Once the code is correct, if it still doesn't work, the issue
is with the compiler not the language.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #8
"Bob Jacobs" <ne****@robertjacobs.fsnet.co.uk> wrote in message news:<bj**********@newsg4.svr.pol.co.uk>...
"penguinman" <ba******@linuxmail.org> wrote in message
news:96**************************@posting.google.c om...
I type ./a.out and the shell just sits there. It doesnt hang it just
sits there looking pretty.

I run the program with the ddd option and executed it from
ddd...execution window comes up and nothing shows up.
I used anjuta same thing. No compiler errors no warnings but it wont
execute.
Checked the permisions of the file and its execute..tried with no
execute from desperation,....same shit.
And yeah i got make.

WTF is missing?

As I said, during compile, NO ERRORS and NO WARNINGS. I demoted my
self to a simple hello world program just to keep things simple


Are you flushing the output stream? Try the following (in the absence of any
posted code on your part):

#include <iostream>
int main()
{
std::cout << "hello, world" << std::flush;
}


#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main ()
{
int x;
cin >>x;
cout<< x<<std::flush;

return 0;

}
Simple code as I said....i run anjuta via shell and when i hit execute i get
in the shell a
Gnome-Message: res is -1 instead of 4
Gnome-Message: gnome_execute_async_with_env_fds: returning -1
/bin/bash: line 1: gnome-terminal: command not found
Jul 19 '05 #9
penguinman wrote:


#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main ()
{
int x;
cin >>x;
cout<< x<<std::flush;
Your programs output must end with a newline if you expect it to be
displayed. Have you been reading the replies?

return 0;

}


-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Jul 19 '05 #10
On 5 Sep 2003 20:34:13 -0700, ba******@linuxmail.org (penguinman) wrote:

#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main ()
{
int x;
cin >>x;
cout<< x<<std::flush;

return 0;

}
Simple code as I said....i run anjuta via shell and when i hit execute i get
in the shell a
Gnome-Message: res is -1 instead of 4
Gnome-Message: gnome_execute_async_with_env_fds: returning -1
/bin/bash: line 1: gnome-terminal: command not found


That is not a C++ question, it's an off-topic tool question.

But perhaps you're expecting that the program should display a prompt
or something.

It doesn't because you haven't told it to.

Jul 19 '05 #11
penguinman wrote:
/bin/bash: line 1: gnome-terminal: command not found

gnome-terminal could not be found. It is not in your path or is
entirely missing from your system. You must install it or find a
suitable replacement (xterm might do but I don't know if the command
args match).

This might be a question better geared toward comp.os.linux.development.apps

NR

Jul 19 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Williams | last post by:
I'm trying to write a simple python program to access a MySQL database. I'm having a problem with using MySQLdb to get the results of a SQL command in a cursor. Sometimes the cursor.execute works,...
242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
3
by: penguinman | last post by:
Its just a hello world program. Compile and build goes with no warning or error. i type ./a.out and the shell just sits there. It doesnt hang but it just sits there with no output. I executed...
6
by: windozbloz | last post by:
Bye Bye Billy Bob... Hello All, I'm a fairly literate windoz amateur programmer mostly in visual basic. I have switched to SuSE 9.2 Pro and am trying to quickly come up to speed with Python...
5
by: Bob Darlington | last post by:
The query below works fine when run from the query grid, but generates Error 3051 when run from code. I have stripped out the Where clause, so that wasn't the problem. I've tried it without the...
2
by: Lasse Edsvik | last post by:
Hello Im trying to run a simple asp.net page and it wont execute......... i run aspnet_regiis -i and it runs successfully..... but my pages wont execute.... what's wrong?? /Lasse
88
by: Peter Olcott | last post by:
Cab you write code directly in the Common Intermediate language? I need to optimize a critical real-time function.
9
by: Martijn Mulder | last post by:
Hi group, It is tempting to jump into .NET programming, especially C# in my case. But I have no idea what the realm is of code based on the CLR. Please inform me of the following: -what...
0
by: CandyClaire | last post by:
hello, I need help here... My index.php page wont submit even after clicking the submit button in a Linux(CentOS) environment.... It would sort of just refresh and then it goes back to the same...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.