Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Oct 31, 2014

Eclipse C/C++: Cannot open output file *.exe: Permission denied

Problem: you want to build/compile your project and you get the error:

cannot open output file FOO.exe: Permission denied


Solution: It's most likely that your EXE is running and can't be overwritten by the compile process. You have to stop all running processes of your EXE. The ones started within Eclipse can be stopped in the debug perspective: Choose all running processes and press the stop button...


If the problem is still not solved, you may have started the EXE outside Eclipse. Go to the task manager (in Windows) > Processes and stop your EXEs.


Eclipse C/C++: for loop initial declarations are only allowed in C99 mode

Problem: you declare a variable in the for loop in Eclipse and you get the error message:

'for' loop initial declarations are only allowed in C99 mode

Solution: use the option -std=c99 for your compiler! Go to: Project > Properties > C/C++ Buils > Settings > Tool Settings > GCC C Compiler > Dialect > Language Standard: choose "ISO C99"

Project > Properties

C/C++ Buils > Settings > Tool Settings > GCC C Compiler > Dialect > Language Standard: choose "ISO C99"


Mar 31, 2014

Tutorial: Installing Eclipse with e(fx)clipse and Scene Builder for JavaFX

For e(fx)clipse you have two possibilites:
OR
  1. As a prerequisite install Xtext & Xtend 2.5.1 on Eclipse:  Help > Install new software... > work with: http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/
  2. Install e(fx)clipse: http://www.eclipse.org/efxclipse/install.html (e.g. for version 0.9.0: Help > Install new software... > work with: http://download.eclipse.org/efxclipse/updates-released/0.9.0/site, check the Kepler-version)
  3. Install Scene Builder: http://www.oracle.com/technetwork/java/javase/downloads/javafxscenebuilder-info-2157684.html


Mar 20, 2014

Tutorial: Installing JDK 7 and Eclipse Kepler SR2

There are two steps required:
  1. Download and install a JDK version 7 (Java Development Kit) 
  2. Download Eclipse IDE (same bit version as for the JRE, i.e. 32 or 64 bit) and unzip

Tutorial: Installing portable MinGW C-Compiler gcc on USB Flash Drive / Stick

If you work on different computers, but always want to have a C compiler with you, just create a portable version on an USB flash drive:
  1. Install MinGW to your computer, e.g. "C:\MinGW\"
  2. Copy "C:\MinGW\" to the USB drive "X:\MinGW\"
  3. Create a text file "X:\MinGW\bin\setpath.bat" with content set path=%path%;%CD%
  4. Run the batch file "X:\MinGW\bin\setpath.bat"
Now the bin directory of MinGW is in the search path. Now you can use the compiler gcc or other MinGW tools...

Tutorial: Installing Eclipse with JDK on USB Flash Drive / Stick

If you work on different computers, but want to have the same dev environment, just create a mobile version on an USB flash drive:
  1. Download Eclipse and unzip on your USB drive, e.g. "X:\eclipse" 
  2. Install a JDK on your computer (e.g. to "C:\Programme\Java\jdk1.7.xx")
  3. Copy "C:\Programme\Java\jdk1.7.x" to "X:\Java\jdk1.7.xx" j
  4. Paste into the file "X:\eclipse\eclipse.ini" just before "-vmargs"
  5.     -vm
        ..\Java\jdk1.7.xx\bin\javaw
  6. Start Eclipse with "X:\Eclipse\eclipse.exe" 
  7. Set the workspace to ".\workspace" (relative path!)
Done!

Mar 19, 2014

Tutorial: Installing Java 8 support for Eclipse Kepler

Java SE 8 has launched (http://www.oracle.com/technetwork/java/javase/downloads/index.html), but what about support in Eclipse Kepler? There is a feature patch (https://wiki.eclipse.org/JDT_Core/Java8), but only for Kepler SR2 (4.3.2). 

Installation (https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler):

  1. Help > Install New Software...
  2. enter the following URL into the 'Work with' field: http://download.eclipse.org/eclipse/updates/4.3-P-builds/
  3. select category 'Eclipse Java 8 Support (for Kepler SR2)'
  4. for faster install, deselect 'Contact all updates sites during install to find required software'
  5. click 'Next', click 'Next', accept the license, click 'Finish', restart Eclipse when asked...

Jan 22, 2013

Tutorial: Installing Eclipse IDE for C/C++ Developers on Windows

Here is a summary of the most important steps:
  1. Download and install a JDK version 8 (Java Development Kit) 
  2. Download Eclipse IDE for C/C++ Developers from http://www.eclipse.org/downloads/ (same bit version as for the JRE, i.e. 32 or 64 bit) and unzip e.g. to C:\dev\eclipse
  3. Download and install a C/C++ compiler (you will need gcc) for Windows, 

    • add the bin directory (e.g. C:\MinGW\bin) to the PATH variable, as before in 1.
    • Check on the command line: gcc
    • You should get: gcc: fatal error: no input files. compilation terminated. (this means gcc is found!!!)
  1. Start Eclipse with eclipse.exe. Then:
    • File > New > C Project
    • Enter a project name of your choice e.g. "helloworld"
    • Select project type "Hello World ANSI C Project" and toolchain "MinGW GCC"
    • Edit the source file:
    #include <stdio.h>
    
    int main(void) {
     printf("C/C++ on Eclipse...\n");
     return 0;
    }
    

  1. Initially build the project: either press Ctrl+B or click the "Hammer" button or right click the project and click "Build Project"
  2. Click the "Run" button. That's it!