问题:

当我尝试在Win32或x64模式下使用Visual Studio 2010编译我的c ++项目时,我收到以下错误:

>C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include\\winnt.h(135): fatal error C1189: #error : "No Target Architecture"

我的预处理器定义说WIN32; _DEBUG; _CONSOLE;%(PreprocessorDefinitions)

导致此错误的原因是什么?如何解决?

// winnt.h: lines 127-136, MSVS says this is an inactive preprocessor block
#if defined(_WIN64)

#if defined(_AMD64_)
#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD )
#elif defined(_IA64_)
#define PROBE_ALIGNMENT( _s ) (TYPE_ALIGNMENT( _s ) > TYPE_ALIGNMENT( DWORD ) ? \
                              TYPE_ALIGNMENT( _s ) : TYPE_ALIGNMENT( DWORD ))
#else
#error "No Target Architecture"
#endif

更新:我创建了一个新的msvs项目并将我的代码复制到它。 我不再有error : "No Target Architecture" ,但现在我有一堆涉及winnt.h和winbase.h的编译错误,并且没有涉及我的任何文件的编译错误。 这些文件是否可能已损坏? 我需要重新安装MSVS 2010吗?

更新2:所以我缩小了我的问题,发现它是#include <WinDef.h>导致我的所有编译错误与winnt.h但我仍然不知道如何解决它。

When I try to compile my c++ project using Visual Studio 2010 in either Win32 or x64 mode I get the following error:My preprocessor definitions say WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)What is causing this error and how do I fix it?Update: I created a new msvs project and copied my code to it.I no longer have error : "No Target Architecture" , but now I have a bunch of compile errors involving winnt.h and winbase.h and no compile errors involving any of my files.Is it possible these files are corrupted?Do I need to reinstall MSVS 2010?Update 2: So I narrowed down my problem and found that it is #include <WinDef.h> that is causing all of my compile errors with winnt.h but I still don’t know how to fix it.

问题:

我正在尝试使用g++-std=c++11c++0x标志进行编译。

但是,我收到此错误

cc1plus: error: unrecognized command line option "-std=c++11"

g ++ –version

g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
Copyright (C) 2006 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.

I’m trying to compile using g++ and either the -std=c++11 or c++0x flags.However, I get this errorg++ –version

问题:

Java中的代码有最大大小吗? 我编写了一个包含10,000行以上的函数。 实际上,每一行都会为数组变量分配一个值。

arts_bag[10792]="newyorkartworld";
arts_bag[10793]="leningradschool";
arts_bag[10794]="mailart";
arts_bag[10795]="artspan";
arts_bag[10796]="watercolor";
arts_bag[10797]="sculptures";
arts_bag[10798]="stonesculpture"; 

而在编译时,我得到这个错误:代码太大

我该如何克服呢?

Is there any maximum size for code in Java?I wrote a function with more than 10,000 lines.Actually, each line assigns a value to an array variable.And while compiling, I get this error: code too largeHow do I overcome this?

问题:

我有一个成员函数,定义如下:

Value JSONDeserializer::ParseValue(TDR type, const json_string& valueString);

当我编译源代码时,我得到:

错误:成员’ParseValue’上的额外限定’JSONDeserializer ::’

这是什么? 如何删除此错误?

I have a member function that is defined as follows:When I compile the source, I get:error: extra qualification ‘JSONDeserializer::’ on member ‘ParseValue’What is this?How do I remove this error?