compilation

Compiling for older versions of Mac OS X

点点圈 提交于 2019-12-08 19:39:57
问题 I have recently started producing applications for the Mac, on my most recent release I got overwhelming suggestions to get the app working on OSX 10.5 as I'm working in and compiling for 10.6. I tried looking for the 10.5 SDK but couldn't find it anywhere to download! How can I go about compiling my app for older versions of Mac OS X using Xcode 2.2 and developing in 10.6? EDIT: ------ I will mention I don't have the to option to select different SDKs as I don't have any others installed and

How to use CoreFoundation in QuickTime SDK for Windows?

夙愿已清 提交于 2019-12-08 19:29:25
Anybody can help me for compile this code in Cygwin / MingW / VS20(05|08|10)? Indeed i want to use CoreFoundation Framework in QuickTime SDK 7.3 for Windows. #include <stdio.h> #include <CoreFoundation.h> int main () { CFStringRef hello = CFSTR("Hello, world."); return 0; } i used this MakeFile for compile it, in Cygwin/MingW, but i get an error :( CC = gcc LDFLAGS = -L"C:/Program Files/QuickTime SDK/Libraries" -lQTMLClient CFLAGS = -Wall -mwindows -I"C:/Program Files/QuickTime SDK/CIncludes" all: StringExample.c $(CC) $(CFLAGS) $(LDFLAGS) -o StringExample StringExample.c -static Carefree

What is the difference between these constructs such that one won't compile?

佐手、 提交于 2019-12-08 18:05:26
A little backstory (ok, a lot): I've been working on creating classes that take java.util.function types and wrap their execution with try/catch blocks to remove the need for using try/catch from within lambda statements. Something that would allow this test code: list.forEach(ExceptionWrapper.wrapConsumer(s -> {throw new Exception(s);})); In doing so, I came up with this. It did not work. public class ExceptionWrapper { public static <T> Consumer<T> wrapConsumer(Consumer<T> consumer){ return t -> { try { consumer.accept(t); } catch (Exception e) { throw new RuntimeException(e); } }; } } Many

dynamic_cast on llvm clang compiler failing

折月煮酒 提交于 2019-12-08 17:47:10
问题 I am seeing a strange failure where the dynamic_cast is returning NULL on clang compiler. But the same code is working with gcc environment. Could you please point me what might be the root cause? What might the difference between the dynamic_cast on llvm and gcc. I am using the default behavior of both the compiler where i think the RTTI is enable by default. template<typename T> T* find_msg_of_type( MsgList *list ) { T* msg = NULL; if (list) { for (std::vector<MsgList*>::iterator it = list-

Redefining function from standard library

落花浮王杯 提交于 2019-12-08 17:24:50
问题 Context: In a recent conversation, the question "does gcc/clang do strlen("static string") at compile time?" came up. After some testing, the answer seems to be yes, regardless the level of optimization. I was a bit surprised to see this done even at -O0 , so I did some testing, and eventually arrived to the following code: #include <stdio.h> unsigned long strlen(const char* s) { return 10; } unsigned long f() { return strlen("abcd"); } unsigned long g(const char* s) { return strlen(s); } int

What is the significance for Ruby programmers of SAP's new implementation of Ruby?

老子叫甜甜 提交于 2019-12-08 16:57:25
问题 SAP announced Blue Ruby, a version of Ruby that runs inside the ABAP Virtual Machine. This seems to lend additional credibility to the Ruby language but, except for SAP developers, does this have any applicability to the rest of the Ruby community? I'm just wondering what other significance this may have. Additional job opportunities, perhaps, for Ruby developers to be hired to work on SAP projects? Any other potential benefits for Ruby programmers? Also, something I'm not clear about:

Deploying to OS X 10.6 and “-fobj-arc is not supported on platforms using the legacy runtime”

时光毁灭记忆、已成空白 提交于 2019-12-08 16:16:41
问题 Background: I'm building an app for OS X with deployment target of 10.6. I have not converted my app to ARC completely, but I am adding a few new classes which would benefit from ARC, so I have set the -fobj-arc compiler flag for those classes. Compiling fails for Universal 32/64-bit Intel architecture, with error -fobj-arc is not supported on platforms using the legacy runtime . Building for 64-bit only succeeds. I'm not well versed in low level architecture. My question is: what is the

Why does the C++ compiler give errors after lines instead of on them?

萝らか妹 提交于 2019-12-08 16:00:14
问题 This question popped into my head today at work when I was having yet another domestic affair with my compiler. Despite my buff pinky (due to all the semicolon pressing I do at work), I managed to miss one before an if statement. Obviously, this resulted in a compile error: error C2143: syntax error : missing ';' before 'if' So I wondered "well gee, why can't you tell me the line that's missing the semicolon instead of the line after the problem." and I proceeded to experiment with other

PLS-00123: program too large (Diana nodes) while trying to compile a package

故事扮演 提交于 2019-12-08 15:31:54
问题 While compiling a package, I ran into an error message: Error: PLS-00123: program too large (Diana nodes) Line: 1 The package in question has about 1k lines (spec) + 13k lines in body. While researching on this, I came across this Ask Tom question When compiling a PL/SQL unit, the compiler builds a parse tree. The maximum size of a PL/SQL unit is determined by the size of the parse tree. A maximum number of diana nodes exists in this tree. Up to 7.3, you could have 2**14 (16K) diana nodes,

CMake: How can I build a shared and a static library without recompiling the sources twice

心已入冬 提交于 2019-12-08 15:07:52
问题 I want to build both a static and shared version of the same library as described Is it possible to get CMake to build both a static and shared version of the same library? However, the sources are compiled twice, one for each version which is not necessary. Is there any way to avoid this? Currently I have: add_library(${LIB} SHARED ${${LIB}_srcs}) add_library(${LIB}_static STATIC ${${LIB}_srcs}) What do I need to change in order to only need to compile once? FYI. I have the same compiler