Hi everyone,
I am not an expert in programming, but managed to get a little c++ program done. Now I would prefer it to have a GUI, so that someone using does not have to use the terminal, and that the program can also run on windows. It is important for me that the programme can come along without the need to install additional libraries. Platform independency would be cool, too.
I have some ideas on how to accomplish this, but also questions regarding it:
The most straight-forward idea would probably be to use libraries such as GTK+ for the GUI. However, my question is whether the GTK+ library only needs to be installed for programming, or also for running the compiled program in the end?
Another idea which came to my mind is to use something like html which can be started locally in a web browser, take some input and then starts my C program, which will also be present locally. I know that it would be quite a security issue if that was launched from a web service, but I want to do all of that locally. Is that even possible?
Finally, an alternative might be to use Java, but despite its platform independency and nice coding I do not like it because the user would have to install the runtime libraries additionally to the program, which seems too complicated.
Thanks for your advice everyone!
3 replies to this topic
#1
Posted 10 June 2011 - 06:40 AM
|
|
|
#2
Posted 10 June 2011 - 06:58 AM
You would be out of luck unless you developed for each platform separately (WinAPI, and many others for Linux flavours.)
You could statically compile GTK or others (i.e. fltk or gtkmm or what have you) in to the executable so the library is within the resulting exe with the tradeoff of size (your executable may be 1mb in the end, or less if you strip it). You could as well dynamically compile it although you would have to distribute the dll along with the file (it could be installed with, or just be in the same folder.)
C++ does not include a window library, so it is just not as straightforward.
You could statically compile GTK or others (i.e. fltk or gtkmm or what have you) in to the executable so the library is within the resulting exe with the tradeoff of size (your executable may be 1mb in the end, or less if you strip it). You could as well dynamically compile it although you would have to distribute the dll along with the file (it could be installed with, or just be in the same folder.)
C++ does not include a window library, so it is just not as straightforward.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 11 June 2011 - 11:07 AM
Regarding the point of java having to require JVM. No matter what platform you need some Library for GUI specific to the platform you want it to run on even if you use .NET or C++. The library could be distributed along with your exe still but the point remains GUI specific to platform is needed to run the code. As a matter of fact JVM or .NET runtime makes things much simpler.
#4
Posted 18 June 2011 - 10:51 PM
Hi,
thanks for your replies. I finally decided on FLTK, a C++ GUI library that can be statically linked. Quite convincing so far, I only hope it supports drag and drop.
Cheers,
Max
thanks for your replies. I finally decided on FLTK, a C++ GUI library that can be statically linked. Quite convincing so far, I only hope it supports drag and drop.
Cheers,
Max
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









