How To Install Dev C++ With Mingw64 Libraries
Posted By admin On 04.01.21Other Libraries and Tools to Use with MinGW
Oct 18, 2015 How to Install Dev-C and the GLUT/freeGLUT Libraries for Compiling OpenGL Programs This tutorial explains how to compile, link, build and run programs written in ANSI C/C with OpenGL and GLUT. We begin by installing the MinGW Installation Manager. This program will allows us to install MinGW and MSYS packages. The MSYS packages provide the shell and the necessary command line tools, but we will not use the Installation Manager to install the MinGW compiler suite. Dec 29, 2014 These steps will install the free compiler Dev c and the free graphics library OpenGL on Windows 8 or 10 64 bit OS. If you have 32bit Windows 7, I believe you add the glut32.dll to the system32.
If you want to compile and build cross-platform Open Source programs that you might typically find in a POSIX environment (Linux, Cygwin or BSD), you'll need some of the standard libraries and tools these systems use to build applicatons. There's still no guarantee a program from another system will port to Windows unless it's been designed to, but many applications that work on POSIX systems can be built and run on Windows with some minor patching. Look for command line tools or programs built on cross-platform libraries like curses (pdcurses on Windows, ncurses on POSIX), gtk+, fltk, fox toolkit, wxwidgets, qt for your best bets on Open Source programs that will port to Windows or may already have ports. If you do get a port running, you can help the project by contributing a mgwport of it so others don't have to try to repeat the work you've done.
Installing Libraries
I usually install libraries in the subdirectories under Msys to prevent library files from co-mingling with compiler files and possibly over-writing needed files. According to the MinGW developers mailing list, the decision was made to put libraries built to be used with MinGW in the subdirectories under the directory MinGW is installed in instead of under Msys. This keeps a division between libraries used to create programs for a standard Windows environment and programs specifically for the Msys environment only. When you look at the MinGW downloads at Sourceforge, most libraries are labeled for MinGW or for Msys. You'll generally want to use the versions for MinGW if you're building a standard Windows application.
Most MinGW files at Sourceforge are in the tar.lzma format. LZMA based compression can help create smaller packages in most cases than other formats like tar.gz (.tgz) and tar.bz2 (.tbz). Both xz and lzma use lzma compression algorithms. I don't know why lzma was chosen over xz for packages with MinGW. According to the creators of both the lzma and xz formats, lzma is being deprecated. See http://tukaani.org/lzma/ for more information. However, you can still decompress lzma files with the xz program using the -lzma switch or use the older lzma program.
To manage libraries or extra files that need to be installed in your compiler directories, you can use a program such as spkg. That way, you don't accidentally over-write compiler files. You can tell which libraries are installed and update them quickly and easily to the next version. You can also uninstall them without having to track down all files in a package when they're no longer needed. To work with Spkg, set the ROOT environment variable to the top level directory where you want to install to (example: SET ROOT=c:MinGW). Spkg requires names of files you install to use the standard Slackware package naming conventions. See the package how-to at http://www.linuxpackages.net. Packages are simply tarballs (a combination of using tar to archive a file and a compression algorithm like gzip or xz or lzma to compress the archived file). Slackware packages also add a few files to an install directory within the tarball to give extra information about the package. These may include a description of the program or library in a slack-desc file and a list of other programs or libraries needed to make it work in a slack-required file. These extra files are optional and aren't necessary to install a package using spkg. Spkg works well for .tgz (.tar.gz) files, but might need some tweaking and program updates for the new .txz format or to handle MinGW packages' use of .tar.lzma. Worst case scenario, you can always decompress and unarchive a package, recreate the package in .txz or .tgz format with a proper name (and even add a slack-desc for better documentation) and then install.
How To Install Dev C With Mingw W64 Libraries System
Some Standard GNU Tools and Libraries
Building Programs
Many programs can be compiled and built in msys using ./configure, make, make install commands. GNU has provided tools to help create and run the files that let you do this.
One of the simpler tools to work with for building applications and libraries is a make file. There's a program called make that uses the information in the make file to build the library or application. For more information, see http://www.gnu.org/software/make/. The make program provided with your latest msys installation should be fairly up-to-date.
For the configure scripts, having up-to-date versions of autoconf and automake are useful. If you don't have the latest, you can download the mingw32 versions from Sourceforge. Install in your MinGW directory (top directory where MinGW compiler suite was installed). According to gnu.org, 'autoconf is an extensible package of M4 macros that produce shell scripts to automatically configure software source code packages'. See http://www.gnu.org/software/autoconf/ for details. Also from the gnu.org site, 'GNU M4 is an implementation of the traditional Unix macro processor'. If you want to know more about M4, see http://www.gnu.org/software/m4/m4.html. A fairly up-to-date version of M4 should have been installed with your latest msys installation. According to gnu.org, 'automake is a tool for automatically generating 'Makefile.in' files compliant with the GNU Coding Standards'. See http://www.gnu.org/software/automake/ for details.
According to gnu.org, 'GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface.' See http://www.gnu.org/software/libtool/ for details. You'll find updated versions of this as well at Sourceforge in the MinGW downloads section. Check the release file for notes. There's mention of an issue with linking against the static libstdc++ runtime. If you get an error that the compiler is trying to find the dll version and there isn't one, be sure to see the note.
Internationalization
GNU also provides some standard tools and libraries for handling internationalization and language issues. These include gettext and libiconv. According to gnu.org, 'the GNU 'gettext' utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages'. See http://www.gnu.org/software/gettext/ for details. According to gnu.org, GNU libiconv is a conversion library for converting between a given text encoding and the user's encoding and for converting between internal string representation (Unicode) and external string representation (a traditional encoding) when programs do I/O. See http://www.gnu.org/software/libiconv/ for details. If you're attempting to build an Open Source application that looks for gettext or libiconv, you'll probably want to add these libraries to your system. You'll find them in the MinGW Sourceforge downloads. Check the release notes file for information on what helper files you need to download and install with these libraries. The MinGW versions (with mingw instead of msys in their file names) are for typical MinGW users and need to be installed in the MinGW directory (top directory where MinGW compiler suite was installed) in order to work properly.
Shared Libraries
POSIX systems use shared libraries (.so) while the Windows standard is the dll. To help bridge that gap, there's a wrapper library, dlfcn. You can download it from http://code.google.com/p/dlfcn-win32/.
Threading
Threading support has been added to later versions of MinGW. Windows compilers don't normally supply POSIX style threading with a standard installation. A library for Cygwin (and MinGW) was created by Red Hat and the Cygwin developers to bridge that gap. You'll find more about POSIX threads here http://sourceware.org/pthreads-win32/. If you've installed pthreads-w32 from the MinGW Sourceforge download page, then you don't need to install the Cygwin version as well.
Screen Libraries
How To Install Mingw
GTK+
/avalon-737sp-vst-download-free.html. GTK+ is one of the more popular cross-platform screen libraries on POSIX systems. It's used by the GNOME desktop and many applications. You can also use GTK+ on Windows. Check the GTK+ site http://www.gtk.org/download-windows.html for useful GTK+ libraries to install and use with MinGW and msys. Some of the libraries on the GTK+ Windows download page are also available in the MinGW download files section. If possible, you'll most often want to use the MinGW versions of these libraries at the MinGW Sourceforge archive. For the main GTK+ libraries such as glib, pango, atk, cairo, it's best to download straight from the source, the GTK+ site. GTK+ can be configured to give a similar look and feel to all GTK+ based applications. See programs such as stardict at Sourceforge for some tools to customize GTK+ themes on your system.
Further Information
How you can help
This is just the start for a list of some of the tools and libraries that can help with porting. The mingwPORT system was designed to help assist MinGW users in adding other useful libraries and tools to their system. It can also be used to build applications. However, developers first need to contribute mingwPORT scripts so that others can use them and save time on patching, porting and installation. There's also a newer system for building and maintaining packages called mgwport which is compatible with Cygwin's cygport system. Please help the MinGW project out by contributing scripts for some of the Open Source programs and libraries you've built with MinGW. The MinGW project also needs a volunteer to write up some information on how to use mgwport.
If you need an easy way to install, uninstall, update and track libraries or applications (tarball packages) on your system, take a look at spkg. It's a good way to avoid the registry for installations (which may be useful with portable apps).
You can help by adding links to other standard Open Source tools and libraries that you've found useful when building applications using MinGW and msys. You can share what versions of various tools described above or found in the MinGW downloads you prefer working with. Do you have any tips for installing or tweaking these libraries and utilities to help you build applications? Please post your favorite tips and tricks below.
Cannot build C++ libraries in MinGW
I have a problem building a library from sourceforge for use in a C++ program. I am trying to use MinGW32-make on a Win 7 machine.
The library has several components, but for example looking at this one:
http://sourceforge.net/p/libosmscout/code/ci/master/tree/libosmscout/
I have tried searching online and my best bet was to (after navigating to the right directory in command prompt) enter this command:
>>mingw32-make autogen.sh && configure.ac && make
The response I get is:
Can someone please give me some tips on how to build these libraries?
Thank you,
T
When you download raw source tree like in your example 'libosmscout' there will be no configure script which is needed for configuration, but you'll find autogen.sh script.
autogen.sh file is used to expand configure script.
once you generate configure script with autogen you then execute configure script to configure.
Once configure script is done configuring you then run make followed by make install.
In order for all these tasks to be successful on Windows the very first thing you need to ensure is to have latest tools such as GNU autotools, compilers and utilities..
Here is how to obtain the latest GNU tools for windows:
Visit below page and follow install instructions:
https://msys2.github.io/
once you do this open the shell (either x32 bit or x64bit depending on your build type) located in MSYS2 installation directory and run following command (copy and paste into console and hit enter)
pacman -S make autoconf autogen automake intltool wget tar itstool bison pkg-config
At this point you can chose which compiler to use with MSYS2 as follows:
To use x64 bit Microsoft compiler and compile the code for Visual Studio, open x64 Visual Studio command prompt and run: (update paths as needed, depending on where you installed MSYS2)
To use Microsoft x86 compiler open x86 command prompt and run:
to use x86 GCC compiler and compile the code for GCC compiler run following from the MSYS2 shell:
pacman -S mingw-w64-i686-gcc
to use x64 bit GCC compiler run this:
pacman -S mingw-w64-x86_64-gcc
Now when you have all the tools you need open MSYS2 shell (again depending on your build type either
mingw32_shell.bat
or mingw64_shell.bat
and cd into sources root directory and run:NOTE, to use GCC just open one of the *.bat files, to use MSVC run one of the *.bat files from Visual Studio command prompt.
to compile with gcc run:
to configure and compile with MSVC run:
If there are any errors let us know, you might need to pass arguments to autogen.sh and configure scripts, but try to run as shown above first and see how it goes.
to learn which additional options you can pass to configure script run:
./configure --help
edit:
it is also possible to generate Visual Studio solution without using command prompts:
You do so by installing CMAKE https://cmake.org/
1. run cmake-gui from Visual Studio command prompt, and give input on where you download the sources, also give input on where to build.
2. click on configure button in cmake GUI (select Visual studio version when asked)
3. select generator and hit generate to generate VS solution
4. open solution and build.
thanks a lot for the detailed explanation codekiddy. Can you break down this command for me please?
The procedure seems to fail at ./autogen.sh step, the output I get is this:
I see that final lines explain the error and suggest how to correct it. But as this is my first time going through this I am quite unsure of what to do =/
then post results.
BTW, do you must use gcc? there is a complete VS solution in the source tree.
the command:
pacman -S make autoconf autogen automake intltool wget tar itstool bison pkg-config
installs tools which you need.
./autogen.sh appears to give same result as before. Then I get this:
By the way, what was autoupdate supposed to do exactly?
Forgot to answer you.. I am using CodeBlocks IDE with MinGW GCC.
BTW, have you read their wiki? there is a list of stuff you need to compile this which ever method you use.
http://wiki.openstreetmap.org/wiki/Libosmscout
you can use pacman from MSYS2 to install all needed stuff if you really must compile with gcc
for example:
pacman -Ss 'packagename'
to list availability of a packagehint: use short name not full name with
-Ss
:for example:
pacman -Ss qt
then:
pacman -S 'full package name'
to download and install.once configure is done, go to libosmscout/src and make sure there are following files:
if they are not there then open
configure
script and use CTRL+F to find LT_INIT(win32-dll)delete
LT_INIT(win32-dll)
and run configure only:and then:
make
post results when done.
The three Makefile files were present after /.configure
It worked fine until
make
command, there's a problem:Makefile:292: *** missing separator. Stop.
Looks like there is problem with 'Program files (x86)' part of the path name with spaces
I searched online, putting
t
at beginning of line didn't helpfor example following installation paths will not work:
both MSYS2 and source code must be somewhere like following (example):
also make sure when (and if) you deleted
LT_INIT(win32-dll)
you deleted only this entry and not more than this.MSYS2 installation is in
C:msys64
Should I uninstall CodeBlocks IDE and reinstall without compiler coupled with it?
Control PanelAll Control Panel ItemsSystem > Advanced system settings> advanced > Environment variables > System variables > Path
make sure there are not mingw or code::blocks paths inside.
you might want to make a backup of a PATH first and then remove mingw and code::blocks stuff from PATH
Mingw64 Install Windows
to check PATH contains only stuff you want in MSYS2 you run:echo $PATH
You can also uninstall code::blocks completely if you wish. and then later reinstall.
you might also want to 're-configure' sources, by running:
make clean
or remove sources as well, and re-clone them to be 100% sure.
edit:
Should I uninstall CodeBlocks IDE and reinstall without compiler coupled with it? |
yes, because there might be problems later when using the library, because you compile library with one GCC version but Code::Blocks uses another version (bundled one)
Only one compiler version should be used, I recommend you to use the one provided with MSYS2.
I edited PATH for System variables, but
echo $PATH
apparently returns User variables, which still include CodeBlocks. Also, I need to add C:msys64mingw64x86_64-w64-mingw32bin
to PATH, right? Since now there is no MinGW there.make sure to delete only those related to mingw and code::blocks installation.
nothing needs to be added to path. MSYS2 PATH has nothing to do with Windows PATH, it only inherits the PATH from Windows and that's the problem here.
yes, you need to repeat the steps to generate new make files.
And then:
It seems there is some compiler (path?) setting that I need to make and is missing.
restart the shell and run:
which g++
it should show you the path to MSYS2 version of g++ compiler
if nothing is shown after restart or there is an error reinstall compiler in MSYS2:
pacman -S mingw-w64-x86_64-gcc
then again:
which g++
run configure only, again.
additionally run:
echo $PATH
and paste output here.
echo $PATH
still showed unaltered one. which g++
says no g++ in (/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Java/jdk1.8.0_51/jre/bin/server:/c/Program Files (x86)/Skype/Phone:/c/CooCox/CoIDE/gcc/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
same after reinstalling compiler with command you provided (I installed 64 bit MSYS2 but was going to use 32bit compiler).
I don't know though what mingw32 in the beggining is doing there. In system settings (env. variables) there is none and also no 'perl.'
pacman -S mingw-w64-x86_64-gcc
installs x64 bit compiler, to use this compiler you need to open mingw64_shell.bat
to use x86 bit compiler you install
pacman -S mingw-w64-i686-gcc
and then open mingw32_shell.bat
.using x64 bit compiler in '32 bit shell' and vice versa is not possible because PATH's are not the same.
please open
mingw32_shell.bat
and install 32 bit compiler:pacman -S mingw-w64-i686-gcc
then run again:
which g++
now it's:
/mingw32/bin/g++