Unix/Linux Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

No output screen when run from file manager

Programming


Reply    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 11-26-2016
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 26 April 2017, 4:32 PM EDT
Location: Loughborough
Posts: 1,188
Thanks: 356
Thanked 318 Times in 248 Posts
Try a little lateral thinking.

This is just an idea I found with some code I am writing. OSX 10.7.5 at the time.

Maybe the terminal IS being generated but your executable is so quick that its task is finished before the terminal is seen, hence the terminal is closed down before it is seen.
In my case it is/was a child shell script that called xterm but was so quick that the only way I knew that xterm had been accessed was that 'X' appeared on the MBP dock.

Try putting your executable inside a shell script and run it using xterm or something similar.
Assuming bash, make the last but one line something like:-

read -r -p "Press <CR> to continue:- " -n 1

This will hold the terminal until the ENTER key is pressed.
Once you have tested that it is executing and holding you can remove this line and maybe use sleep <seconds> as a replacement.
The last line, which is optional, should be exit ...

This is just an idea...
Sponsored Links
    #9  
Old Unix and Linux 11-26-2016
pinbot pinbot is offline
Registered User
 
Join Date: Nov 2016
Last Activity: 2 December 2016, 10:59 PM EST
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks wisecracker, but unfortunately my program is not that quick. It takes a good 30 secs to run and when I associate it with terminal, terminal opens and just sits there till I close it.
I also tried installing another terminal (xterm as you mentioned)
and the results are the same.
Sponsored Links
    #10  
Old Unix and Linux 11-26-2016
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 26 April 2017, 11:10 PM EDT
Location: NM
Posts: 11,024
Thanks: 515
Thanked 1,046 Times in 969 Posts
Quote:
But at some point I'm going to forget that .txt file is executable.
Oh.
This is what I suspected earlier. Should have said something. MY bad. Something is wrong in your desktop config file.

Here is a step by step:
Adding new item in the menu - Linux Mint Community

Covering another earlier assumption I had:

-- what does the command "file executable_file_name " think about your executable. There is a header file in C for so-called magic. The file command should recognize your compiled file regardless of name or extension - correctly as an executable image file -- may call it one of several things. If it thinks it is a data file or a binary you have a serious configuration problem. Since bash can run it I am assuming this is not the case.

Last edited by jim mcnamara; 11-26-2016 at 06:21 PM..
    #11  
Old Unix and Linux 11-28-2016
pinbot pinbot is offline
Registered User
 
Join Date: Nov 2016
Last Activity: 2 December 2016, 10:59 PM EST
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jim mcnamara
This is what I suspected earlier. Should have said something. MY bad. Something is wrong in your desktop config file.

I don't think there's any problem with my linux. To test I tried
running from another partition with a different mint install and
also from an live debian cd and the results were the same.

Is there a linux equivalent to building a windows console program? or maybe write a script to open in terminal?
I've only been using linux about a month so there's a lot I'm
unfamiliar with. Thanks for the input.
Sponsored Links
    #12  
Old Unix and Linux 11-29-2016
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 26 April 2017, 4:32 PM EDT
Location: Loughborough
Posts: 1,188
Thanks: 356
Thanked 318 Times in 248 Posts
Here is an idea...
Open up a terminal and now that you have xterm installed try from the open terminal this...

Code:
xterm -e your_command_with_args

Let us know what the display results are, error or otherwise...
Sponsored Links
    #13  
Old Unix and Linux 12-02-2016
pinbot pinbot is offline
Registered User
 
Join Date: Nov 2016
Last Activity: 2 December 2016, 10:59 PM EST
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Thanks for the ideas but also a no go.
Xterm opens and just sits there with no output until I close
it.

So what I've done is installed the Allegro library (because I'm familiar with it from win) and added code to make the program
open in a window. All is well now, thanks for all the input everyone.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Awk script to run a sql and print the output to an output file adept Shell Programming and Scripting 4 06-10-2012 10:40 AM
Redirect the output in a file and on screen dynamax Shell Programming and Scripting 3 05-23-2011 11:44 AM
Complete Screen Output to Log File enjoy Shell Programming and Scripting 1 04-26-2010 02:42 PM
Seeing the screen output beyond the scroll capability for the last run command bimukt UNIX for Dummies Questions & Answers 1 05-02-2008 04:22 AM
Putting screen output in a log file nsutti Shell Programming and Scripting 5 11-06-2007 04:47 PM



All times are GMT -4. The time now is 05:12 AM.