I have windows 8.1 OS.
I wanted to run a basic C++ program using openGL so i downloaded a compatible Turbo C++ software of 64 bit.
When I run my program I got errors because it said unable to open the header file i.e., graphics library. Are there any primary things like setting up a path in environmental variables, which URL should I paste? Or let me also please know if there's any other common things that I need to set up in-order to use the Graphics Library. Thank you.
Do not use Turbo C/C++ , Try any modern IDE (Codeblock , codelite , dev-c++ or any other). Read this
http://www.codeblocks.org/downloads/26
In IDE you will get all common header files plus examples , you will get an OpenGL example here . I suggest you to try codeblock.
Why not to use Turbo C/C++ (https://stackoverflow.com/a/1962710/4499919)
OpenGL isn't suppported by TC++.
However you can run a simple C graphics program using graphics.h
Open Options and select Directories from it.
Related
I am trying to plot circle using graphics.h library but all the tutorials and examples I have seen had "C:\TurboC\BGI" in the initgraph() function. As long I understand, the mentioned path leads to the graphics driver, but in my my PC I was unable to find any BGI file.
I am using mingw-w64 environment on visual studio code.
Is there any different command or add-on I should install to access graphics programming in c++?
It would be a lot of help, if anyone can suggest any alternative way to do graphics programming in c++.
Go to https://github.com/ananay/turboc OR download Turbo C++ software then use the installation location (which is C:/ in above example) /TurboC/BGI
BGI files come with Turbo C++
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.
I have installed NppExecute plugin in notepad++. I am not able to figure out next step to compile and debug C,C++ programs in Notepad++.
System Details: (a) Turbo C directory C:\TC (b) OS Windows 7
Please provide complete details on how to set Environment Variable and Scripts for Compiling and Debugging.
Notepad++ has the run feature, but as far as I know it's unable to help you debugging (e.g. stepping through code, watching variables, etc.).
Your best bet would be using a simple batch file to compile the code and run your debug commands, but as far as I know you can't include everything into Notepad++ (i.e. it's no real C/C++ IDE).
Only option you've got is adding the created batch file as the program to be run by NppExecute.
Edit:
Overall, as rkosegi suggested, if possible, use a more up-to-date toolchain.
Microsoft's Visual C++ Express Edition can be downloaded for free and used for private or commercial projects.
If you target cross platform code, it might be easier to use MinGW to use GCC/G++ under Windows.
I wondering why somone wants to use turbo C++.If you run Windows, just use Visual Studio Express, or Dev-C++.If you still want to use Turbo C you will run into several problems with compatibility of this ancient software.
I'm working on developing my own programming language, and to generate executables I wished to convert the source to C++ and the run it through a C++ compiler.
Does anybody know of a C++ compiler which I can simply include with my application and then invoke from the command line without installation?
I'm using Windows.
Thanks in advance, Tom.
Edit:
It seems gcc is the way to go and it would be a pain to set up, would people recommend bundling the installation file instead and then installing the compiler as part of the installation of my program?
Have you tried gcc (the windows port)?
I need to generate a pdf from a c++ application. I am using Xcode and I would like to stick to that. Possibly the solution needs to be opensource. I already tried a few, but ecountered issues:
I tried podofo but I had some issues when building it - it seems that does not work on OS X.
I wanted to use ClibPDF, but that is no more available for download.
When including PDFlib oder PDFlib Lite in my projects that does not work either, I get some strange memory errors on runtime.
Has anyone an idea what could be used with C++/XCode for pdfs? Thanks in advance!
To create a podfo Xcode project use the following in Terminal:
cmake -G "Xcode" -DWANT_FONTCONFIG:BOOL=YES -DCMAKE_INSTALL_PREFIX=/opt/podofo -DCMAKE_INCLUDE_PATH=/opt/local/include -DCMAKE_LIBRARY_PATH=/opt/local/lib ../podofoSrcDir
The Mac OS X drawing library, Quartz, supports PDF natively.