porting wxwidgets opengl application to not library dependent application - c++

I want to port wxwidgets opengl application that will be not library dependent.I want at least that it can be compiled without additonal libraries. I am thinking to port it to MFC or maybe WIN32.What is the most easiest?Maybe you have some other suggestion?

MFC is by far the easiest. It's also the only realistic option if you don't want to use libraries that aren't installed with Visual Studio.

You do realize, that MFC is just another library and works much like wxWidgets. The only difference is, that MFC ships with Visual C++. However if you were to compile with GCC (MinGW), then you'd have to obtain MFC somehow.
Also the whole boilerplate code for event handling and the like is rather prone to write. I say: Stick with wxWidgets, it's cross plattform, well supported and if you're scared by installing and using libraries, then you should not do programming.

Although one answer is already checked, taking the question the way it was worded, the answer is wrong. MFC is just an other dependency, although shipped with Visual Studio. You still need to ensure that the correct version is installed on the users system. The only real way to solve this problem is to go Win32 with WGL. Then you depend on nothing but OS libraries. (You probably still need to install the vcredist package though...)

Related

Easily importing c++ libraries and dependencies on windows

I want to use some of the great libraries out there (e.g. cgal), but don't know how (have been exclusively writing my own code so far).
It seems every library requires a different process in order to use it (at least on windows)
I'm currently using Clion as an IDE in Windows 10 with minGW. I've tried using the Conan dependency manager but couldn't get it to work (and the documentation/video tutorials are not done very well).
Is there a recommended simple way to do it?
Is using vcpkg with visual studio a good way to go about it?
edit: for clarification, I am an academic physicist developing scientific simulations mostly to be used by myself, so I don't have to package my code with all the dependencies included.
Thanks.

c++ gui window cross platform

I would like to make c++ that will work both on Linux and windows as I understand if I use the win32 template in visual studio then it will only work on windows is there something built into c++ like java's jframe that I can use. Also I would like to use any external library at this time.
Here are some cross platform alternatives QT, wxWidgets, Ultimate++. I have used QT, it is intuitive with a huge collection of tools to use in your code. The others are also popular but I have never used them.
I make used of wxWidgets due to it's cross platform and even cross architecture, native look on the OS where it appear. Binary application yields by wxWidgets is small enough thus make it possible to linking statically as portable application. Qt produce huge binary if linked statically (and may be violate qt licensing scheme).
Another reason are licensing flexibly, well documentation and supported by huge community arround the world. wx is considered as mature framework since it first release about 20yrs ago. It's use standard C++ syntax and preprocessor that will make you easily switch from plain C or C++. Complete library are available ranging from appeal window GUI, string, network, stream, webview, xml, and wx is playing very well with 3rd party library as such database SOCI, Asio, etc ....
You may try start to code with wxWidgets easily using Eclipse-IDE and wxFormBuilder as GUI designer. Plese check my experience for ease setup it's IDE+Toolchain. This wx installer can be used do develop, test and run wx application on Linux desktop, and then deploy the binary on Raspberry Pi is available for another board target beside Linux x86_64.
http://yasriady.blogspot.co.id/2016/01/raspberry-pi-toolchain.html
There is a cross-platform application & UI development framework called Qt. I think it meets your requirements. Click here for more info.
There is a long list of both active and dead cross-platform C++ UI libraries here: https://philippegroarke.com/posts/2018/c++_ui_solutions/

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.
You can either use a library that can be statically linked (MFC, WTL) or use Win32 API directly.
WxWidgets have static linking capability, never tried it myself.
If you want portabiliy, and yet don't want to depend on 3rd party libraries... well you'll have to provide portability yourself! Don't do it! As adviced by OneOfOne, use Qt and be impressed how simple yet powerful it is. Good luck!
You can also use Qt5, works great on windows and when you figure out that windows isn't the only OS out there, you can easily port it to everything else.
License issues : Proprietary Source code + LGPL Source code

Gtk3 developing on windows

I am new (relatively) to C++ and to SO.
Having stretched the creativity of console applications to the limit, my very rabid mind wants to know how to code GUIs now. I did some research, decided to use GTK rather than Qt because of having freedom of choice, there being no strings attached and something about slow internet and having to download some 0.6GB were I to go with Qt.
It has been a brutal 48 hours trying to build 'Hello World' on Gtk. This is me throwing a tantrum. I'm using Visual Studio 2010. Perhaps this is the source of all my woes. It seems Gtk is meant for C and not C++. After solving issues with header files includes and a certain notorious glibconfig.h missing (which I downloaded from the internet only to find, to my horror,that it is supposed to be a generated file), the compiler threw syntax errors,especially in one gatomic.h.
I suspect 10 errors will come up for every one I manage to solve. This is where you come in. Do you use Gtk to develop c++? If not, why so? What would you recommend instead? Do you use Gtk on windows? How is that possible? Please give details.
Is it possible to make cross-platform apps that use C++ code and a Python/VB GUI?
Your answer will be sincerely appreciated.
First off, a general note: Gtk being mainly developed as a toolkit for Gnome, I think it is fair to say that the main focus is high quality on Linux while other platforms are somewhat second-class citizens. This is probably most visible by looking at the integration with the native look and feel of Windows and MacOS. If you are looking for a toolkit which behaves equally well on all major platforms, I'd recommend you reconsidered Qt.
As far as your more specific questions are concerned:
C/C++
Gtk is written in C, and consequently has a C API. If you are looking for a C++ API, look at the Gtkmm bindings. Note that you can also use the C API in a C++ application.
glibconfig.h
I don't know whether you tried compiling Gtk yourself, but the easiest way to get Gtk3 for windows is by downloading the precompiled all-in-one bundle from http://www.gtk.org/download/win32.php (which includes the glibconfig.h you are missing).
When and how to use Gtk and with what language
As pointed out above, the primary users oft Gtk are people who develop applications for the Gnome desktop environment. Most cross-platform applications nowadays however use Qt since the quality on Windows and MacOS is higher compared to Gtk on those platforms.
Concerning what langauge to use, a strength of Gtk is that there exists bindings for many languages (including C++ and Python), so you are certainly not confined to C.
When developing with C++, something that I personally like about Gtkmm is that it uses the standard library, as opposed to Qt which has it's own implementations for data structures etc (the reason being that Qt predates the times when the STL was generally available and usable on all main platforms).
How to use Gtk: contrary to Qt which has the excellent Qt Creator, Gtk is somewhat lacking a specifically designed IDE for easy development. The closes you'll get is using Glade for interface design and a text editor or IDE of your choice for the coding, but that choice will differ depending on the platform you are on. Clearly, as you probably noticed, integrating Gtk into the environment of choice usually requires some work (and also some more technical knowledge). So again, if you are looking for an easy to set-up and use environment for developing GUI applications, I'd just go with Qt and Qt Creator.
Cross-Platform apps
First off, Visual Basic is not cross-platform. But generally speaking, there are plenty of possibilities for doing cross-application development, using various languages.
I've had to get a gtk3 project working on windows a few months ago, when gtk3 just came out for windows. I've had problems compiling it under Visual Studio as well, and posted a question here, specifically this one.
Here's how I got it working on windows:
Download the all-in-one bundle for Windows from gtk.org
Install, etc, set up include/link dirs within the project. (personally, I dumped gtk's folders in the project folder, pointed at "include" as an include dir and "lib" as a link dir, then proceeded to move any files/folders the compiler cannot find around to the root of "include" )
If not set up automatically, add include and link dirs as necessary until the compiler finds all the files.
If using MinGW to compile, it will succeed at that point.
If using Visual Studio, you have to modify gtk headers as described in the gtk mailing list:
In gutils.h lines 82 and 122, and in gstring.h line 129, change
"static inline" to "static __inline".
Blockquote
Note that the modification does not impact MinGW's ability to compile.
I have successfully compiled my gtk3 project on both windows (with either Visual Studio or Code::Blocks) and linux without writing platform-specific code that way. Just don't forget to include the required runtime dlls with the program when you ship it.

Transition from MFC to QT

Currently all our GUI components are written in MFC. Our build environment is:
VC 6
Windows XP
I have no idea whether:
1) We can replace all MFC components with Qt, without changing build environment ?
2) Qt will work with VC6 as any other library?
You answers will help me in getting started, In the mean time I have installed Qt 4 and am trying to build some samples.
If we can replace all MFC components with QT, without changing build environment ?
Yes, you even get a MFC/Qt migration framework cf qt.nokia.com/products/appdev/add-on-products/catalog/4/Windows/qtwinmigrate/
Will Qt work with VC6 as any other library ?
VC6 is more than 10 years old!
Qt supports VC6 until version 4.5
The next release (4.6) will drop VC6 support cf qt.nokia.com/doc/4.6-snapshot/qt4-6-intro.html#performance-optimizations
You probably shouldn’t use VC6 with Qt 4.5. (see doc)
Apart from that: If your project compiles with Qt, you can easily* switch to Qt components. Qt uses its own componentens anyway, so there’s no other dependencies involved.
However, to set up the Qt environment, you might need to do a few changes to your build system, unless you’re not working with QObjects. (Think of the moc pre-processor.)
*: easily in the sense of being able to start using Qt components. The amount of work needed to actually migrate MFC components to those of Qt is something I don’t know anything about.
Replacing MFC to QT requires a big work to do. First of all you should think whether you need that. Second, Qt could be integrated with Visual Studio.
I learned something very useful when trying to port one client's MFC application to Qt.
I do a lot of refactoring. That doesn't scare me at all. However, I am usually incrementally changing things. That makes a huge difference.
I started porting the MFC application to Qt just after the LGPL version of Qt was released, but before the LGPL release of 'qtwinmigrate' (get it at ftp://ftp.qt.nokia.com/qt/solutions/lgpl/). At the time, I thought Qt was going to hold on to the MFC migration stuff as an incentive for the commercial license.
I had to convert a good number of files before ever being able to compile the project. Once the very basics were up and running, I slowly re-added dialogs until the functionality matched the original version. This was much harder than being able to keep your existing MFC app running as is and slowly replacing dialogs.
So, the point is... USE QTWINMIGRATE!
Oh yeah... and don't use VC6. Upgrade to something more recent.