Tag Archives: eclipse c

Setting up development environment on Windows for developing in C and C++. Install MSYS shell environment, the MinGW C++ compiler and eclipse cpp

1. Installing the Eclipse cpp for C and C++

Download the latest version of the eclipse cpp from here:
https://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/heliossr2

Install it. Start eclipse and make changes in Project build to build only with ‘make’ command and not with ‘make all’.

2. Installing the mingw-get installer

Download the latest version of the mingw-get installer. To do it, click on the following link

http://sourceforge.net/projects/mingw/files/latest/download

to go to the mingw-get installer automated builds download webpage at SourceForge. Once you reach the webpage, click on the file for last version of mingw. This will start the downloading of the mingw-get installer. When prompted if to open or to store the file in your computer, select the appropriate option to store file on your computer.

Once the MinGW installer is in your PC, right-click upon it to extract its content. If you are asked for  Installation folder use  “C:\MinGW\”. Sonst move or copy the “MinGW” folder after Installation into the folder “C:\MinGW\”.

Installing the MinGW

Download the latest version of the MinGW . To do it, click on the following link

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

to go to the MinGW automated builds download webpage at SourceForge. Once you reach the webpage, click on the file for last version of mingw. This will start the downloading of the MinGW . When prompted if to open or to store the file in your computer, select the appropriate option to store file on your computer.

Once the MinGW installer is in your PC, right-click upon it to extract its content. If you are asked for  Installation folder use  “C:\MinGW\”. Sonst move or copy the “MinGW” folder after Installation into the folder “C:\MinGW\”.

After install rename the mingw-make.exe to make.exe. It is situated in C:/MinGW/bin folder.

3. Installing the MSYS

Now, to download MSYS Environment go to the following link:

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

and click for the last MSYS version binary. After the download is finished, extract it to “C:\MinGW”.

Installing msysDTK

http://sourceforge.net/projects/mingw/files/Other/Unsupported/MSYS/msysDTK/msysDTK-1.0.1/msysDTK-1.0.1.exe/download?use_mirror=cznic

Download and install in C:\MinGW\msys\1.0

4. Configuring MSYS to use with MinGW

After the installation is completed, open a MSYS shell console at “C:\MinGW\msys\msys.bat” and type:

sh /postinstall/pi.sh
  • Type “y” to continue with the installation.
  • Type “y” to say that MinGW is installed.
  • Enter “c:/MinGW” as the MinGW installation location.

5. Environment Settings

When you install command line tools, such as MinGW, or GnuWin32 tools, you have to tell the command line interpreter where to find them. This is usually accomplished by adding the appropriate directory names to the PATH variable in your user environment. The installers will not do this for you.

NOTE If you choose to alter your PATH variable, you must ensure you alter your user PATH variable, not your system PATH variable — there are two of them!

NOTE The MinGW team do not recommend modifying the system wide Windows PATH variable. We prefer that you use a script to set PATH for the processes on a per session basis. See the notes in the “After Installation You Should” section above.

Warning: Adding entries to the PATH is normally harmless. However, if you delete any existing entries, you may mess up your PATH string, and you could seriously compromise the functioning of your computer. Please be careful. Proceed at your own risk.

  1. Right-click on your “My Computer” icon and select “Properties”.
  2. Click on the “Advanced” tab, then on the “Environment Variables” button.
  3. You should be presented with a dialog box with two text boxes. The top box shows your user settings. The PATH entry in this box is the one you want to modify. Note that the bottom text box allows you to change the system PATH variable. You should not alter the system path variable in any manner, or you will cause all sorts of problems for you and your computer!
  4. Click on the PATH entry in the TOP box, then click on the “Edit” button
  5. Scroll to the end of the string and at the end add
    ;<installation-directory>\bin
  6. press OK -> OK -> OK and you are done.

NOTE: Substitute <installation-directory> with the FULL absolute path name of the installation target directory you chose (ie C:\MinGW);

If you installed MSYS, you may also want to add “;<installation-directory>\MSYS\1.0\bin”, and “;<installation-directory>\MSYS\bin” to the end of your user PATH variable.

6. Install Additional MinGW Packages

Start a MSYS shell. In the shell window, execute the following commands:

mingw-get install libz
mingw-get install bzip2
mingw-get install msys-man

7. Install GnuWin32 Packages

he GnuWin32 project is a collection of open source programs and libraries ported to Windows. These also work well with the MinGW compiler, and Icarus Verilog uses a few pieces from this collection.

From the GnuWin project, download the following packages:

  • gperf-3.0.1-bin
  • readline-5.0.1-bin

NOTE: You need the binaries and the developer files, but you do not need the source to these packages.

From the downloaded gperf-3.0.1-bin zip archive:

  1. drag and drop bin\gperf.exe to <mingw>\bin

From the downloaded readline-5.0.1-bin zip archive:

  1. drag and drop bin\* to <mingw>\bin
  2. drag and drop lib\* to <mingw>\lib
  3. drag and drop include\* to <mingw>\include

where <mingw> is the location you chose to install MinGW.

NOTE: readline is only required to enable command line editing when in the vvp interactive mode

 8. Install Git for Windows

NOTE: Skip this step if you only wish to build from snapshots.

From the http://msysgit.github.io/ , download and install the Git for Windows binary package.

NOTE: When installing, you must select the option of “Checkout as-is, commit Unix-style line endings”.

The installation will leave a “Git Shell” icon on the desktop and in the Git sub-menu of your Start menu. This icon brings up a shell window (a command line) that has paths all set up for executing Git commands.

9. Get the Git Source

NOTE: Skip this step if you don’t want to build Git.

Start a Git shell. In the Git shell window, change directory to the location where you wish to store the source code and execute the following command:

git clone git://repo.or.cz/git/mingw.git git

This will create a directory “git” that contains all the source code for git.

The path to the directory containing the source code is referred to as <git-source> in subsequent instructions.

NOTE: Make sure there are no spaces in the <git-source> path names. Use forward slashes in place of back slashes when using <git-source> in a MinGW Shell.

10. Build and Install Git

NOTE: Skip this step if you don’t want to build Git.

In the MinGW shell window, execute the following commands:

cd <git-source>
make NO_OPENSSL=YesPlease NO_TCLTK=YesPlease NO_GETTEXT=YesPlease INSTALL=/bin/install prefix=/usr/local install

You can now uninstall the Git for Windows binary package if you wish, as Git commands can now be executed in the MinGW shell.

Files To Get

Download at least the following (or newer) packages from the MinGW Download Page. Where two or more component packages are indicated, you need both / all of them.

  • binutils (bin and dev)
  • mingw-runtime (dev and dll)
  • w32api
  • Required runtime libraries for GCC:
    • mpc (dev and dll)
    • mpfr (dev and dll)
    • gmp (dev and dll)
    • pthreads (dev and dll)
    • iconv (dev and dll)
    • zlib
    • gettext
  • gcc-core (bin and dev and dll)

The above are the minimum requirements for a working C Language compiler using the MinGW GCC toolchain.

You can also add one or more of the following optional compilers or tools. For each you choose to install, you need all three of the bin, the dev and the dll component packages:

  • gcc-c++ (bin and dev and dll) for C++
  • gcc-objc (bin and dev and dll) for Objective C
  • gcc-fortran (bin and dev and dll) for Fortran 90/95
  • gcc-java (not yet available) for Java
  • gcc-ada (bin and dev and dll) for Ada

Note that the GCC versions of these files must match the GCC version of the gcc-core installed.

You can also add the following additional utilities:

  • mingw-gdb and libexpat for debugger
  • mingw32-make for make
  • mingw-utils for MinGW Utilities