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


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 11-24-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
No output screen when run from file manager

So I have ported a C++ program from windows to linux
and when I run it from terminal all is well. However
when executed from file manager there is no screen output.
The program runs and does what it should, just the problem
of not knowing if there are errors or if its even complete. Is there a way to have it open in terminal automatically?
Thanks.
Sponsored Links
    #2  
Old Unix and Linux 11-25-2016
rbatte1 rbatte1 is offline Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 21 August 2017, 11:23 AM EDT
Location: Lancashire, UK
Posts: 3,208
Thanks: 1,369
Thanked 616 Times in 557 Posts
Well, without knowing what you code is supposed to do, how it talks to the screen etc., it's a bit difficult.

Are you saying that this is written for a text screen session, but you want to fire it from the GUI? You might need to associate the file type with a program in the GUI (I've only done this on Windows) in such a way that it opens a console session to run the command. Of course this might affect all files with that suffix.

You could also write a wrapper that opens the console and forces the command in too.



I hope that this helps,
Robin
Sponsored Links
    #3  
Old Unix and Linux 11-25-2016
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 21 August 2017, 6:24 PM EDT
Location: NM
Posts: 11,144
Thanks: 555
Thanked 1,083 Times in 1,004 Posts
Basic C++ code uses stdout, and does not "know" about Windows at all. Windowing requires a fair amount of code - when you run something like it has to call whatever windowing libraries your system has.

Visual Studio handles that in Windows. Since we know zero about your system, we are giving you "zero" kinds of answers. If you want actual help:
1. what UNIX/Linux system
2. what gui do you have? KDE, Gnome, etc.
3. do you use an IDE on the UNIX/Linux side?


If the program is smallish, posting the code will also help.
The Following User Says Thank You to jim mcnamara For This Useful Post:
rbatte1 (11-25-2016)
    #4  
Old Unix and Linux 11-25-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
Here are my system details:
EDITION="Cinnamon 64-bit"
DESCRIPTION="Linux Mint 18 Sarah"
DESKTOP=Gnome
TOOLKIT=GTK


Quote:
Originally Posted by rbatte1
Are you saying that this is written for a text screen session, but you want to fire it from the GUI?
Correct!

Quote:
Originally Posted by jim mcnamara
3. do you use an IDE on the UNIX/Linux side?
No, compile from the command line.

Funny thing is just about anything with a file extension I double click in file manager will give me the option to run
in terminal but not this. Mint doesn't show an option to add gnome terminal under "open with other application"
Sponsored Links
    #5  
Old Unix and Linux 11-26-2016
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 21 August 2017, 5:07 PM EDT
Location: Aachen, Germany
Posts: 11,185
Thanks: 287
Thanked 3,447 Times in 3,176 Posts
You may want to check the configuration files for links between your program's extension and the terminal to open. Or, for a test, you could give it an extension that opens a window.
Sponsored Links
    #6  
Old Unix and Linux 11-26-2016
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 21 August 2017, 6:24 PM EDT
Location: NM
Posts: 11,144
Thanks: 555
Thanked 1,083 Times in 1,004 Posts
Specifically your file associations are broken or do not exist:

Run the file manager (Caja), right-click on the file, select Properties and the Open With tab. Now, click on one of the radio buttons for the listed applications. If none shows, the file you create from compiling has to have recognized extension, as RudiC said. Try .exe as the extension:

from the command line:


Code:
mv output_file output_file.exe
# or if it already has an extension:
mv output_file.[whatever is here] output_file.exe

Re-run Caja.
The Following User Says Thank You to jim mcnamara For This Useful Post:
rbatte1 (11-28-2016)
Sponsored Links
    #7  
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
Quote:
Originally Posted by jim mcnamara
Run the file manager (Caja), right-click on the file, select Properties and the Open With tab. Now, click on one of the radio buttons for the listed applications. If none shows, the file you create from compiling has to have recognized extension, as RudiC said. Try .exe as the extension:
I have done this and there is no terminal listed, I have manually added terminal but all that will do is open terminal and not run the program.


I have renamed extension exe,bin,run and they all behave the same as the current no extension.

Quote:
Originally Posted by RudiC
Or, for a test, you could give it an extension that opens a window.
If I rename to .txt extension, double clicking program
will open dialog with option to run in terminal and it will execute without problem with visible screen output.
But at some point I'm going to forget that .txt file is executable.
Even renaming the extension something like .runme won't work
Sponsored Links
Closed

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 11:23 PM.