简体   繁体   English

无法为Clion安装MinGW

[英]Can't install MinGW for Clion

Recently I installed Clion, but couldn't compile even "Hello World" application. 最近我安装了Clion,但是甚至无法编译“Hello World”应用程序。 I install MinGW compiller separately, but when I try to compile "Hello world" app I have next errors: 我单独安装MinGW compiller,但是当我尝试编译“Hello world”应用程序时,我有下一个错误:

In file included from c:\mingw\include\wchar.h:45:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cwchar:44,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\postypes.h:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iosfwd:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from C:\Users\Alexandr\ClionProjects\untitled2\main.cpp:1:
c:\mingw\include\wctype.h:67:1: error: '_CRTIMP' does not name a type
 _CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t);
 ^
...........
 ^
c:\mingw\include\wctype.h:76:1: error: '_CRTIMP' does not name a type
 _CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t);
 ^
c:\mingw\include\wctype.h:77:1: error: '_CRTIMP' does not name a type
 _CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t);
 ^
c:\mingw\include\wctype.h:80:1: error: '_CRTIMP' does not name a type
 _CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t);
 ^
c:\mingw\include\wctype.h:84:29: error: expected initializer before 'iswblank'
 int __cdecl __MINGW_NOTHROW iswblank (wint_t);
                             ^
c:\mingw\include\wctype.h:90:1: error: '_CRTIMP' does not name a type
 _CRTIMP wint_t __cdecl __MINGW_NOTHROW towlower (wint_t);
 ^
c:\mingw\include\wctype.h:91:1: error: '_CRTIMP' does not name a type
 _CRTIMP wint_t __cdecl __MINGW_NOTHROW towupper (wint_t);
 ^
c:\mingw\include\wctype.h:93:1: error: '_CRTIMP' does not name a type
 _CRTIMP int __cdecl __MINGW_NOTHROW isleadbyte (int);
 ^
c:\mingw\include\wctype.h:157:33: error: expected initializer before 'towctrans'
 wint_t __cdecl __MINGW_NOTHROW  towctrans(wint_t, wctrans_t);
                                 ^
c:\mingw\include\wctype.h:158:35: error: expected initializer before 'wctrans'
 wctrans_t __cdecl __MINGW_NOTHROW wctrans(const char*);
                                   ^
c:\mingw\include\wctype.h:159:34: error: expected initializer before 'wctype'
 wctype_t __cdecl __MINGW_NOTHROW wctype(const char*);

How can I fix it? 我该如何解决?

I just installed a fresh copy of MingW correctly and selected a lot of package to install, after that you install CLion 1.1.1 and set the path to c:\\MingW\\bin to your environment variable PATH 我刚刚正确安装了MingW的新副本,并选择了很多软件包进行安装,之后安装了CLion 1.1.1并将c:\\ MingW \\ bin的路径设置为环境变量PATH

Inslall link for MingW: http://sourceforge.net/projects/mingw/files/ 鸣叫的链接: http//sourceforge.net/projects/mingw/files/

I created a hello project and compiled it, all things works correctly 我创建了一个hello项目并编译它,一切正常

Here is the result of execution of hello world and there is no compiler problem 这是执行hello world的结果,没有编译器问题

If there is a path problem, as I had, you have to de-install and install CLion to recognize your path as I did 如果存在路径问题,就像我一样,你必须卸载并安装CLion来识别你的路径

在此输入图像描述

Tested under windows 7 在Windows 7下测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM