Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i make a portable C++ program for Windows with GUI, independent from .NET or other Libs?

I want to make a C++ program with Graphical User Interface, to be running on Windows platforms.

I want it to be independent from any libraries like .NET.

The reason I want this is because I want this program to be able to run everywhere, in every version of Windows (XP, VISTA, 7 - 32 & 64bit) without the user to be bound to have already installed a library like .NET.

Also, I want it to be portable: the whole program to consist from only one exe file.

So to summarize:

How can I make an one-exe-file GUI C++ program, able to run on all versions of Windows, without the need of pre-installed libraries on Windows from the user that uses it?

I have already MS Visual C++ 2010 Express and Eclipse with Cygwin's G++ compiler installed on my system.

Notice: I don't mind to use any libraries for windows GUI design if there is a way to embed them inside the executable file of the program.

like image 294
MinimalTech Avatar asked Oct 01 '22 15:10

MinimalTech


2 Answers

You can either use a library that can be statically linked (MFC, WTL) or use Win32 API directly.

like image 57
Nemanja Trifunovic Avatar answered Oct 05 '22 13:10

Nemanja Trifunovic


WxWidgets have static linking capability, never tried it myself.

like image 26
UldisK Avatar answered Oct 05 '22 12:10

UldisK