MinGW-w64 - for 32 and 64 bit Windows
url:http://sourceforge.net/projects/mingw-w64/mingw-w64-install.exe
C:\Users\leo>gcc --version
gcc (i686-posix-dwarf-rev1, Built by MinGW-W64 project) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Eclipse IDE for C/C++ Developers:
url:http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/lunasr1
download:eclipse-cpp-luna-SR1-win32.zip
Package Description
An IDE for C/C++ developers with Mylyn integration.
This package includes:
C/C++ Development Tools
Eclipse Git Team Provider
Mylyn Task List
Remote System Explorer
Detailed features list
问题:Unresolved inclusion: <stdio.h>
解决办法:Project->Properties->C/C++ Build->Environment
Add:
name:Path
value:C:\Program Files\mingw-w64\i686-4.9.2-posix-dwarf-rt_v3-rev1\mingw32\bin
问题:"This file requires compiler and library support for the ISO C++ 2011 standard." 需要支持C++11
解决办法:Project->Properties->C/C++ Build->Settings->Tool Settings->Cross GCC Complier->Miscellaneous->Other flags:
添加: -std=c++11 "-c -fmessage-length=0 -std=c++11"; GCC在make时, 添加C++11的特性.
'for' loop initial declarations are only allowed in C99 or C11 mode
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int len =10;
int arr[len];
for(int i=0;i<len;i++){ //'for' loop initial declarations are only allowed in C99 or C11 mode
printf("index:%d arr:%d \n",i,arr[i]);
}
return EXIT_SUCCESS;
}
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int len =10;
int i;
int arr[len];
for(i=0;i<len;i++){
printf("index:%d arr:%d \n",i,arr[i]);
}
return EXIT_SUCCESS;
}
A program file was not specified in the launch configuration.
.exe未指定
* array.c
*
* Created on: 2015年2月21日
* Author: leo
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int main(void)
{
int32_t len =10;
int32_t i;
int32_t a;
int32_t arr[len];
for(a=0;a<len;a++){
arr[a]=0;
}
for(i=0;i<len;i++){
printf("index:%d arr:%d \n",i,arr[i]);
}
return EXIT_SUCCESS;
}
index:0 arr:0
index:1 arr:0
index:2 arr:0
index:3 arr:0
index:4 arr:0
index:5 arr:0
index:6 arr:0
index:7 arr:0
index:8 arr:0
index:9 arr:0
leo_618@2015-02-21