K
K
Kirill2020-03-13 23:46:10
WordPress
Kirill, 2020-03-13 23:46:10

How to compile a C++ program for Linux?

Good afternoon.

I have a fairly easy question, to which for some reason I find it difficult to find an answer.

I wrote a lightweight program that asks you to enter your first and last name, then writes those files to a .txt file. Question: how to make it possible to run the program not from the console (./programm), but, for example, as in Windows by clicking on the file with the .exe extension.

P.S. Thanks for taking the time

Answer the question

In order to leave comments, you need to log in

8 answer(s)
T
ThemeReview, 2019-08-08
@qpiu1

The easiest way to make this mega menu a plugin is the same Groovy mega menu, you can add WooCommerce widgets to the mega menu blocks

L
Lord_Dantes, 2019-08-08
@Lord_Dantes

If you need to dynamically throw goods there. I would not make WP functional, there you need to get confused a lot.
BUT as for me and how I would do it. I would make an ordinary static menu, I would simply write where you need cycles for category products, etc.
In essence, this is how it is. Knowledge is needed, this can be done for about 600-700 rubles.

Z
zorca, 2019-08-08
@zorca

Uber Menu

S
Sergey Gornostaev, 2020-03-14
@sergey-gornostaev

Rewrite the program using one of the GUI libraries. For example Qt .

R
Ronald McDonald, 2020-03-14
@Zoominger

Make the file executable through its properties.
Well, or from the console: chmod -x ./program

R
Roman, 2020-03-14
@myjcom

g++ main.cpp -o main -no-pie
But the application is console. So you need to run from the console environment.
Upd:
You can try ncurses

R
rPman, 2020-03-14
@rPman

to launch an application from the GUI, you need to create a shortcut in this GUI, depending on your environment (gnome/kde/xfce, etc.) the instructions will be different but similar. In general, if your application is a console application, then you need to run it using the terminal, there are also a lot of them to choose from, from the most ancient and primitive xterm to pants for each DE, for example, for kde it is kconsole.
here are examples of commands for different terminals so that the window does not close after the program ends:
https://switch-case.ru/71821000

C
CityCat4, 2020-03-14
@CityCat4

I understand that the question actually has nothing to do with C ++, although I did not quite understand what was needed. To have an icon on the desktop, by clicking on which you can start the program? So you need to create a shortcut, where you must specify - the program starts in the terminal. For example:

[Desktop Entry]
Comment=SSH telnet session to blabla.bla
Exec[$e]="ssh -l blabla 1.2.3.4"
GenericName=
Icon=/opt/trinity/share/icons/Win7.Lookalike.2011.03.08/48x48/emblems/centos_fancy48x48.png
Name=SSH Login to blabla.bla
Path[$e]=
StartupNotify=true
Terminal=1
TerminalOptions=-geometry 112x41 -title "server terminal" -j -ls
Type=Application
X-TDE-SubstituteUID=false
X-TDE-Username=

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question