[SOLVED] My newly compiled programs/applications do not work as i expected
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There is no reason to add headers unless you actually need them.
2-
Quote:
Although for example you could define "OK" such as
Quote:
Code:
#define OK = 1
3-
Quote:
Variables are critical parts of programming. They are really unavoidable.
1- My knowledge is not at the level that i can decide exactly which headers are needed , but just based on my general understanding and guessing i decide .
One example is that computer works on the mathematics and computing base so a math.h header (latest/best) possibly always will be useful.
2- I do-not/did-not define OK as 0 or 1 , i just defined that as the real meaning of it.
Here again i am going to be dragged into discussion ..but i have to answer just to answer , so i enter the discussion again :
I believe/understand that we are moving on the wrong basis , because :
Code:
OK != 0/1
True != 1/0
False != 0/1
but they have their real meanings as i mentioned before and you can see those meanings in any English dictionary
Here there is/was/has-been a problem :
Humans originally/mainly used their feet to move , but now/today they use wheels (cars, etc) , air-planes , ships , space-ships ...and far tomorrow ..maybe jump as in the movie named : jumper etc
So we have to use our feet (old definitions) while moving towards jumping !..etc
Most/nearly-all software are based on the old definitions , even computers bios and hardware are designed to work on the 0||1 (do-something or do-nothing) but it is the wrong basis !
I do not know how this must be , or , what exactly we should do , but i know that we should start moving forward while still using our feet !
3- variables are a basis for experimenting but not common in nature , but programming/programmers are mainly using variables (which are virtual and not real facts) ... as you said :
Quote:
they are unavoidable
..but they should not be basis for programming/computer-training ..
Sorry if i waste time
This is a thread that has been going on since last September. Your original question seemed to be that you self-studied C programs, they were mostly all console based programs and you wanted to know how to make them run either from a GUI or present GUI based widgets as part of your programs.
This is possible, more likely from C++ when you use toolkits such as Qt (excellent, but rather difficult to set up), and FLTK (easier to set up, less well documented). And what I mean by this, is similar advice which others have related. The C language itself does not have functions which provide output widgets to interface with any operating system's window manager, rather each system type has library functions which allow a programmer to access and control GUI based widgets. To make it easier to use, toolkits like Qt or FLTK provide API functions to do this; however you have to install and use those toolkits as part of your process to make an executable function.
A recommendation is to try Qt and follow their documentation to do the equivalent of a GUI based hello world function, for Qt. I have a very old book, there's probably updates C++ GUI Programming with Qt, Blanchette & Summerfield. My version is 5 or 6 years old and based off of Qt4, I'm sure there's something newer and likely online. Within that book the first lesson is how to write hello world, but in GUI form.
As far as the question of include files, I do find that keeping to the minimum required include files is better versus having that list be non-necessarily long merely because you copy/paste as you create new programs. And how to tell what you need versus don't. Well, if you look at the manpage for common functions: printf(), scanf(), and so forth, at the top of the manpage it shows you the required include functions for that system library function.
Hi
I visited the Qt.software site , the only applicable result was their newspaper subscription ! because :
-I can not buy software ....no international credit cards here !
- I do not want to buy software ...i am self learning ,self ...i want to do any thing (in this regard) myself !
This much i know about Qt :
It seems that it is on the core of my OS ...and i have tried to use #qtconf a few times in the past
Maybe i can do more later.. Thank you for your helping attention
Last edited by irajjs; 02-11-2014 at 04:04 AM.
Reason: changing two words which were not correct/fit
-I can not buy software ....no international credit cards here !
- I do not want to buy software ...i am self learning ,self ...i want to do any thing (in this regard) myself !
Please stop being so pro-actively defensive. You absolutely can do this on your own as well as for free.
Qt has a free variation http://qt-project.org/downloads, and you will have to do a lot by yourself with that because after you download the .tar.gz file you then need to configure, make, and install the toolkit. After which you can actually use their toolkit and libraries. When you perform the configure, it asks you about what license you wish, you choose the free variation.
Another point to consider is that Qt and FLTK are both in source form; therefore you can read their source and learn from how they create graphics; should you desire to learn how to create graphics via your own programming.
Hi
Let me explain about my being defensive first :
Once i downloaded a source code from a web site , then while trying to install i took a look at that source code ... the contents as much as i understood was an stepwise action like this :
- get data from system
- send data to ...site
- download ...
- install/make the program
- report to site
Now you tell me what is the difference between Linux free software and Windows/Microsoft related ones ?
I think if i want to do it this way Windows is all ready made , but controlled by others ..
Off course most possibly Qt site is not as that web site which i mentioned , although they tried to run scripts on related pages ...which i generally do not like this action , because i do not know about the contents of those scripts ... possibly they are trying to get data about the ip address and country , location .. etc .. but they can ask about it rather than just getting it directly by using an script .. and if they can not trust on me , then , how do i trust on them ?
Finally the question is that i could not find the link to the tar-gzip-32-source .. but the found name was : Qt 5.2 run !
Regards
More than 260 apps now! There has been some progress
I just wanted to inform to those who might be interested
I had to manage a cataract surgery
It is hard to work with this mobile device .. and i will never connect to Intetnet using my computer ..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.