compiler-options

How do I increase the stack size when compiling with Clang on OS X?

强颜欢笑 提交于 2019-11-27 03:18:17
问题 Can I specify the stack size with clang++? I can't find any compiler options that would allow me to do so. I'm using OS X. Note: This question specifically refers to Clang, not the GCC compiler. 回答1: The linker, rather than the compiler, is responsible for setting the stack size of the main thread. The man page for ld contains the following: -stack_size size Specifies the maximum stack size for the main thread in a program. Without this option a program has a 8MB stack. The argument size is a

The g++'s -g option equivalent to VS2010 cl compiler?

一个人想着一个人 提交于 2019-11-27 01:12:54
问题 With g++ with -g option, I can use gdb for debugging purposes. What's the equivalent to this option with Visual Studio 2010 cl.exe compiler? This page has different libraries (debug/release) for linking. If I compile with debugging option with cl.exe, do I have to use the corresponding library linking options (/MD/MT vs /MDd/MTd)? 回答1: There are a few separate pieces to this question: how to tell the compiler/linker to generate and preserve "debug information" (mapping between source code and

msbuild, defining Conditional Compilation Symbols

て烟熏妆下的殇ゞ 提交于 2019-11-27 01:05:47
I'm possibly just blind, but is there a command line to specify conditional compilation symbols in MSBUILD? I currently have this Line in my buildscript: SET MSBUILD=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe SET CONFIG=Debug %MSBUILD% /p:Configuration=%CONFIG% /p:OutputPath=..\..\output source\MyProject\MyProject.csproj And I'd like to add a condition. In Visual Studio, i can just go into Project Properties => Build => Conditional compilation symbols, but I have not seen that option for msbuild? Bonus Karma if you know if I can completely override all symbols already specified

What does the fpermissive flag do?

旧巷老猫 提交于 2019-11-27 00:29:13
I'm just wondering what the -fpermissive flag does in the g++ compiler? I am getting: error: taking address of temporary [-fpermissive] which I can solve by giving the -fpermissive flag to the compiler. EDIT : I just found what was causing the temporary address error part! I'm going to fix that part right now. cli_hlt Right from the docs : -fpermissive Downgrade some diagnostics about nonconformant code from errors to warnings. Thus, using -fpermissive will allow some nonconforming code to compile. Bottom line: don't use it unless you know what you are doing! David Schwartz The -fpermissive

“Register for COM Interop” vs “Make assembly COM visible”

别说谁变了你拦得住时间么 提交于 2019-11-26 18:53:30
问题 What is the real difference between these two options? What I know is: Register for COM Interop This options executes regasm on the assembly and registers the assembly as an COM component(or maybe not) in the registry with all COM like registry entries. Does this step generates a TLB file? What else is done? Sometimes I see a tlb is generated when I compile the project but sometimes not, why is this? Make assembly COM visible What effect does this one has on an assembly? If I have the

Break in Class Module vs. Break on Unhandled Errors (VB6 Error Trapping, Options Setting in IDE)

折月煮酒 提交于 2019-11-26 17:52:15
问题 Basically, I'm trying to understand the difference between the "Break in Class Module" and "Break on Unhandled Errors" that appear in the Visual Basic 6.0 IDE under the following path: Tools --> Options --> General --> Error Trapping The three options appear to be: Break on All Errors Break in Class Module Break on Unhandled Errors Now, apparently, according to MSDN, the second option (Break in Class Module) really just means "Break on Unhandled Errors in Class Modules". Also, this option

Qmake: how to remove compiler flag for a certain project, without changing qmake.conf?

一笑奈何 提交于 2019-11-26 17:14:01
问题 I'm using qmake and Visual Studio. In release build qmake adds /GL and /O2 flags to all projects, and I need to remove those two flags for certain libraries within my whole Qt project. Is there a way? 回答1: The only way this could work is QMAKE_CFLAGS -= /GL /O2 but I doubt this works for QMAKE_CFLAGS . Alternatively, you could redefine QMAKE_CFLAGS , forgetting its previous value: QMAKE_CFLAGS = $$CFLAGS_WITHOUT_GL_O2 回答2: I had a similar problem and I solved it by adding the following

How to tell if a .NET application was compiled in DEBUG or RELEASE mode?

一笑奈何 提交于 2019-11-26 16:10:55
I have an application installed on my computer. How do I find out if it was compiled in DEBUG mode or not? I've tried to use .NET Reflector , but it does not show anything specific. Here is what I see: // Assembly APPLICATION_NAME, Version 8.0.0.15072 Location: C:\APPLICATION_FOLDER\APPLICATION_NAME.exe Name: APPLICATION_NAME, Version=8.0.0.15072, Culture=neutral, PublicKeyToken=null Type: Windows Application I blogged this a long time ago, and I don't know if it still valid or not, but the code is something like... private void testfile(string file) { if(isAssemblyDebugBuild(file)) {

What is the difference between the /Ox and /O2 compiler options?

Deadly 提交于 2019-11-26 12:40:03
问题 Microsoft\'s C++ compiler ( cl.exe , as included with Visual Studio) offers several optimization switches. The difference between most of them seems self-explanatory, but it\'s not clear to me what the difference is between /O2 (which optimizes code for maximum speed) and /Ox (which selects \"full optimization\"). I\'ve tried reading the documentation for the /Ox option, and it seems to confirm that this switch also enables optimizations for maximum speed, rather than size: The /Ox compiler

msbuild, defining Conditional Compilation Symbols

这一生的挚爱 提交于 2019-11-26 09:29:37
问题 I\'m possibly just blind, but is there a command line to specify conditional compilation symbols in MSBUILD? I currently have this Line in my buildscript: SET MSBUILD=C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\MSBuild.exe SET CONFIG=Debug %MSBUILD% /p:Configuration=%CONFIG% /p:OutputPath=..\\..\\output source\\MyProject\\MyProject.csproj And I\'d like to add a condition. In Visual Studio, i can just go into Project Properties => Build => Conditional compilation symbols, but I have not