如何编辑Microsoft Visual Studio 2013编译器开关? [英] How do I edit Microsoft Visual Studio 2013 Compiler switches?

查看:358
本文介绍了如何编辑Microsoft Visual Studio 2013编译器开关?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑和同事的注意事项:



请不要投票,因为没有努力研究以下问题。
我创建这个为了回答任何人谁可能有未来的问题,所以他们实际上会在研究过程中再次询问之前找到这个问题。为了这个目的,它是清楚的措辞,以便出现在这个特定主题的Google搜索。请注意,我是创建它的人,然后立即回答它。这意味着以清晰和简洁的方式添加知识库。谢谢。



这个问题类似于其他关于 / bigobj 的问题,但是,这些没有直接解决编译器选项。这具体回答了编译器选项的一般问题,并处理特定编译器选项的单独问题,甚至进一步链接其他类似的问题,以便比其他更容易找到。请考虑删除其他不链接/覆盖更广泛的范围,并不那么彻底的。



我需要初始化一个超过16641个元素的结构。

  #includestdafx.h
#include< iostream>

struct ArtificialIdiocy {
double x,y,z;
double nx,ny,nz;
};

int _tmain(int argc,_TCHAR * argv []){
ArtificialIdiocy objectArray [16641];

objectArray [0] .x = 1.012709;
objectArray [0] .y = 0.069911;
objectArray [0] .z = 1.010933;
objectArray [0] .nx = 0.165410;
objectArray [0] .ny = 0.883572;
objectArray [0] .nz = -0.438063;

objectArray [1] .x = -1.000000;
objectArray [1] .y = 0.014457;
objectArray [1] .z = 1.000000;
objectArray [1] .nx = 0.179296;
objectArray [1] .ny = 0.883511;
objectArray [1] .nz = -0.432661;

objectArray [2] .x = 1.000693;
objectArray [2] .y = 0.011744;
objectArray [2] .z = -1.000509;
objectArray [2] .nx = 0.172582;
objectArray [2] .ny = 0.897122;
objectArray [2] .nz = -0.406629;

//依此类推....

  objectArray .x = 0.969018; 
objectArray .y = 0.116736;
objectArray .z = 0.967181;
objectArray .nx = 0.437513;
objectArray .ny = 0.782861;
objectArray .nz = 0.442335;

objectArray .x = 0.968575;
objectArray .y = 0.105999;
objectArray .z = 0.998326;
objectArray .nx = 0.561235;
objectArray .ny = 0.718528;
objectArray .nz = 0.410718;

objectArray .x = 0.999139;
objectArray [16640] .y = 0.089730;
objectArray .z = 0.997266;
objectArray .nx = 0.608631;
objectArray [16640] .ny = 0.688559;
objectArray .nz = 0.394208;

但是MSVS2013编译器告诉我,我的结构体有很多部分和退出,错误说明: / p>

错误1错误C1128:已超过的段数目标文件格式限制:使用
编译
/ bigobj



如何编辑/添加/ bigobj编译器开关?

解决方案

对于MSVS Express 2013,打开您的项目属性页,转到C / C ++树项,然后向下到最后一个选项命令行 。点击此处,然后在其他选项文本框中添加任何其他开关。



在这种情况下, strong> / bigobj 。

/ p>

MSVS的处罚linker flag / bigobj



使用MSVS 2010和C ++标准的Build问题



如何使用/ bigobj在Dymola(Modelica)中编译



将此问题链接到其他人时发现了以下情况:



http://msdn.microsoft.com/en-us/library/ms173499%28v=VS.100 %29.aspx



http://msdn.microsoft.com/en-us/library/8578y171.aspx


Note to editors and peers:

Please do not down vote this as not showing an effort to research the following question. I created this in order to answer the question for anyone who may have it in the future, so that they will in fact find this during research before asking it again. It is clearly worded for this purpose, so as to appear in Google searches on this specific subject. Please note that I was the one who created it, and then immediately answered it afterwards. It's meant to add the the knowledge base in a clear and concise way. Thank you.

This question is similar to other posted about /bigobj issues, however, these did not directly address the compiler options in general. This specifically answer the general question of compiler options, and handles the separate issue of the specific compiler option as well, and even goes further to link other similar questions in order to be more easily found than the others. Please consider deleting others which don't link/cover a broader range, and are not as thorough.

END NOTE

I need to initialize a struct with over 16641 elements.

    #include "stdafx.h"
    #include <iostream>

    struct ArtificialIdiocy{
        double x, y, z;
        double nx, ny, nz;
    };

    int _tmain(int argc, _TCHAR* argv[]){
        ArtificialIdiocy objectArray[16641];

        objectArray[0].x = 1.012709;
        objectArray[0].y = 0.069911;
        objectArray[0].z = 1.010933;
        objectArray[0].nx = 0.165410;
        objectArray[0].ny = 0.883572;
        objectArray[0].nz = -0.438063;

        objectArray[1].x = -1.000000;
        objectArray[1].y = 0.014457;
        objectArray[1].z = 1.000000;
        objectArray[1].nx = 0.179296;
        objectArray[1].ny = 0.883511;
        objectArray[1].nz = -0.432661;

        objectArray[2].x = 1.000693;
        objectArray[2].y = 0.011744;
        objectArray[2].z = -1.000509;
        objectArray[2].nx = 0.172582;
        objectArray[2].ny = 0.897122;
        objectArray[2].nz = -0.406629;

// so on, and so on....

        objectArray[16638].x = 0.969018;
        objectArray[16638].y = 0.116736;
        objectArray[16638].z = 0.967181;
        objectArray[16638].nx = 0.437513;
        objectArray[16638].ny = 0.782861;
        objectArray[16638].nz = 0.442335;

        objectArray[16639].x = 0.968575;
        objectArray[16639].y = 0.105999;
        objectArray[16639].z = 0.998326;
        objectArray[16639].nx = 0.561235;
        objectArray[16639].ny = 0.718528;
        objectArray[16639].nz = 0.410718;

        objectArray[16640].x = 0.999139;
        objectArray[16640].y = 0.089730;
        objectArray[16640].z = 0.997266;
        objectArray[16640].nx = 0.608631;
        objectArray[16640].ny = 0.688559;
        objectArray[16640].nz = 0.394208;

But the MSVS2013 compiler tells me that my struct has to many sections and quits with an error stating:

" Error 1 error C1128: number of sections exceeded object file format limit : compile with
/bigobj "

How do I edit/add the "/bigobj" compiler switch?

解决方案

For MSVS Express 2013, open your projects "Property Pages", go to the "C/C++" tree item, and then go down to where you see the very last option, "Command Line". Click on this, and add any additional switches in the "Additional Options" text-box.

In this case, you would add "/bigobj", all lower-case letters.

See also:

Penalty of the MSVS linker flag /bigobj

Build issue with MSVS 2010 and the C++ standard

How to compile with /bigobj within Dymola (Modelica)

Just found the following while linking this question to others:

http://msdn.microsoft.com/en-us/library/ms173499%28v=VS.100%29.aspx

http://msdn.microsoft.com/en-us/library/8578y171.aspx

这篇关于如何编辑Microsoft Visual Studio 2013编译器开关?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆