473,656 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4897

penguinman <ba******@linux mail.org> wrote in message
news:96******** *************** ***@posting.goo gle.com...
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******@linux mail.org> wrote in message
news:96******** *************** ***@posting.goo gle.com...
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******@linux mail.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******@linux mail.org> wrote in message
news:96******** *************** ***@posting.goo gle.com...
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****@robertj acobs.fsnet.co. uk> wrote in message news:<bj******* ***@newsg4.svr. pol.co.uk>...
"penguinman " <ba******@linux mail.org> wrote in message
news:96******** *************** ***@posting.goo gle.com...
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****@robertj acobs.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****@robertj acobs.fsnet.co. uk> wrote in message news:<bj******* ***@newsg4.svr. pol.co.uk>...
"penguinman " <ba******@linux mail.org> wrote in message
news:96******** *************** ***@posting.goo gle.com...
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_a sync_with_env_f ds: 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

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

Similar topics

2
5045
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, sometimes not. From mysql: mysql> show databases; +-----------+ | Database |
242
13327
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 comments on past experience, research articles, comments on the matter would be much appreciated. I suspect something like C would be the best based on comments I received from the VB news group. Thanks for the help in advance James Cameron
3
4421
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 the program in ddd, execution window opened up and I got a blank. I executed the program using Anjuta same thing. In all cases the program had no errors or warning. But there is no
6
1606
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 2.3.4. I can run three or four line scripts from the command line but have not been able to execute a script from a file. I have used EMACS and JEDIT to create small test routines. I would right click the file and set properties to executable. I...
5
1518
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 Sum() functions, but still the same errors. Could the problem be the complexity of the SQL? INSERT INTO tArrearsGrouped ( PropNum, SortOrder, LAN, PropName, ShopNum, TenantName, Arrears1, Arrears2, Arrears3, BF, Receipts, Bal, CurrentCharge, Var,...
2
1061
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
8037
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
1688
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 versions of Windows can execute .NET code? -can I deliver dll-files to older Windows versions? (ME, 2000, 98) so as to run .NET code? -what percentage of today's software is written using the .NET architecture?
0
1140
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 page again.. Did I forget something to set in my php.ini?? Im sure that my codes are alright... As this system that im running is working fine in a windows environment..
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8600
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7311
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.