- Dev C++ For Windows 10
- How To Install Dev C++ With Mingw64 Libraries List
- How To Install Dev C With Mingw W64 Libraries System
Sep 05, 2019 How To Install MinGW-w64 on Windows 10. Likewise, the binutils package provides a “dev” package that includes libraries, such as libiberty.a and libbfd.a,. TDM-GCC contains compilers based on MinGW64/TDM-GCC. These compilers can create both 32bit and 64bit executables and generally ship with much more Microsoft related headers and libraries. When you place these compilers in Dev-CppMinGW64, Dev-C can automatically configure them on first launch or via Tools Compiler Options Find Compilers. Dec 12, 2018 graphics programming in dev c with examples graphics in dev c rar graphics in dev c free download bgi graphics c graphics.h download for. Dec 27, 2011 Download and install the latest full release of Dev-C. Setup and portable versions will work. Download and install this overwrite update and extract it in the Dev-C's main folder. Download and install TDM-GCC 4.6.1 x64 to 'MinGW64'. This folder should be placed next to devcpp.exe.
GCC is a very good compiler collection, and is fully free (in speech and beer). There are however a ton of Windows distributions spread over the internet, but only some are of high quality. There's a lot of choices to be made as well, so I've made all those for you so you don't have to worry, and get good defaults.
We will use the MinGW-w64 port packaged with MSYS2. This also allows us to use *nix toolchains to build other libraries, as well as use the precompiled libraries that MSYS2 provides. Note that MSYS2 provides MinGW-w64 compilers. Binaries with these compilers will be standalone, and do not require a
cygwin.dll
or similar file.I assume your development machine is 64-bit, and you want your compiler to target 64-bit windows by default. We will install both a 32-bit and a 64-bit target compiler toolchain, regardless.
If you have a 32-bit development machine, change every occurrence of
C:devmsys64
with C:devmsys32
below. However, it's <current year>
, get a 64-bit machine.- Download msys2-x86_64-latest.exe and run it. If your development machine is 32-bit, download msys2-i686-latest.exe instead. Make sure to set the install directory to
C:devmsys64
(C:devmsys32
for 32-bit). Choose to run MSYS2 right now. - In the MSYS2 shell, execute the following. Hint: if you right click the title bar, go to Options -> Keys and tick 'Ctrl+Shift+letter shortcuts' you can use Ctrl+Shift+V to paste in the MSYS shell.
- Close the MSYS2 shell once you're asked to. There are now 3 MSYS subsystems installed: MSYS2, MinGW32 and MinGW64. They can respectively be launched from
C:devmsys64msys2.exe
,C:devmsys64mingw32.exe
andC:devmsys64mingw64.exe
. If the installer created any shortcuts to open shells for these subsystems, you can update them to these locations to get pretty icons. Each subsystem provides an environment to build Windows applications. The MSYS2 environment is for building POSIX compliant software on Windows using an emulation layer. The MinGW32/64 subsystems are for building native Windows applications using a linux toolchain (gcc, bash, etc), targetting respectively 32 and 64 bit Windows. We will install ourPATH
such that these tools can be called from regular cmd.exe as well, and we need only use the MinGW subsystem to install/update MSYS2 packages or if our build setup requires a *nix shell. Hint: after starting up MSYS2, the prompt will say which version you launched. - Reopen MSYS2 (doesn't matter which version, since we're merely installing packages). Repeatedly run the following command until it says there are no further updates. You might have to restart your shell again.
- Now that MSYS2 is fully up-to-date we will install GCC and common build tools. When you are queried to select packages and confirm the installation just press enter:
- Add
C:devmsys64mingw64bin
andC:devmsys64mingw32bin
, in that order, to yourPATH
. Note that MSYS2 also puts a lot of other tools in this directory, most notably Python. So put these entries below any other tools you might have installed in your PATH.
Done. Now you can use
gcc
, g++
, etc to get your 64-bit targeting compiler from your regular command line. To make 32-bit binaries, use i686-w64-mingw32-g++
and co.To be safe and reproducible, MSYS2 by default disables inheriting your
PATH
settings in their environments. You can toggle this option per environment by looking in the respective .ini
file in C:devmsys64
for MSYS2_PATH_TYPE=inherit
. My recommendation is to inherit the path for the MinGW32/64 environments, but keeping the MSYS environment pure.The instructions below are an example of installing a library, this part is not required.
First and foremost I suggest checking the package manager of MSYS2. It has a lot of pre-built library packages. You can search the package repository using
pacman -Ss your_library
, for example:If the package name starts with mingw, it's a library. Install it using
pacman -Sy package_name
, e.g.:Sadly there is no wildcard, but you can use
pacman -Sy `pacman -Ssq boost`
to install everything returned by a search.If your library is not in the package manager you must compile it yourself. As an example, we'll try and build the 64-bit zlib library (this is an excercise - zlib is installed already by default):
- Open
mingw64.exe
(and if not already, cd to~
). - Download and unpack zlib:
- Configure, compile and install:
Cannot build C++ libraries in MinGW
Dev C++ For Windows 10
Pages: 12
Greetings,
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
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
Hi,
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)
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:
to use x64 bit GCC compiler run this:
Now when you have all the tools you need open MSYS2 shell (again depending on your build type either
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:
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.
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.
Hi,
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 =/
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 =/
You can ignore these errors for now, to fix the problem run following commands one by one:
then post results.
BTW, do you must use gcc? there is a complete VS solution in the source tree.
the command:
installs tools which you need.
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.
Last edited on Dec 7, 2015 at 7:50pm UTC
Thank you for quick replies.
./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.
./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.
Last edited on Dec 7, 2015 at 8:10pm UTC
dude, this won't be easy you know without installing all the stuff you need, why not using provided VS solution or CMAKE (see edit in my first post for updates) ?
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:
hint: use short name not full name with
for example:
then:
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.hey, I've downloaded the sources and it compiles just fine with, a few small fixes are needed. are u still there?
I am still here yes, trying to absorb your explanations in messages. I am new to building 3rd party libraries and this one surely doesn't look like one to start learning with =) But I need to use this library in an application. How did you make it work?
run following:
once configure is done, go to libosmscout/src and make sure there are following files:
if they are not there then open
delete
and then:
post results when done.
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.
Last edited on Dec 7, 2015 at 8:46pm UTC
So the warning in my very first attempt was relevant after all?
The three Makefile files were present after /.configure
It worked fine until
Looks like there is problem with 'Program files (x86)' part of the path name with spaces
I searched online, putting
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 helpdirectory where libosmscout source code is must not contain spaces, as well as MSYS2 installation must not be installed into location that contains spaces.
for 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
for 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.Ah, the problem is much nastier. libosmscout path does not have any spaces. But Makefile line that caused the mentioned error is path to:
MSYS2 installation is in
Should I uninstall CodeBlocks IDE and reinstall without compiler coupled with it?
MSYS2 installation is in
C:msys64
Should I uninstall CodeBlocks IDE and reinstall without compiler coupled with it?
![Dev c++ 5.11 Dev c++ 5.11](/uploads/1/2/6/5/126529736/870598169.png)
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
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 removed CodeBlocks path, but I suppose I need to repeat steps from your earlier post so the correct Makefile is produced, right?
I edited PATH for System variables, but
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.clear both user and system variables related to code::blocks and mingw, in control panel.
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.
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.
No good =/ that's what I get:
And then:
It seems there is some compiler (path?) setting that I need to make and is missing.
And then:
It seems there is some compiler (path?) setting that I need to make and is missing.
hm, did you restart the MSYS2 shell after changing PATH in Windows?
restart the shell and run:
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:
then again:
run configure only, again.
additionally run:
and paste output here.
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.
I did restart because
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.'
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++
How To Install Dev C++ With Mingw64 Libraries List
I suppose I was clusmy here, sorry about that.
now it's:
now it's:
/mingw32/bin/g++
How To Install Dev C With Mingw W64 Libraries System
Pages: 12