compilation

Compiling C++ code makes the system hang

我的未来我决定 提交于 2019-12-29 07:51:30
问题 When I try to compile this file by issuing the command, "g++ qr.cpp -o qr" The system hangs. I haven't seen this kind of an error anywhere else. #include<iostream> using namespace std; bool win[1000000001]; bool know[1000000001]; int sixes[] = {6, 36, 216, 1296, 7776, 46656, 279936, 1679616, 10077696, 60466176, 362797056}; bool check(int n){ cout << n << endl; if(!know[n]){ bool b = check(n-1); for(int i=0; i<11; i++){ if(n > sixes[i]){ b = b & check(n-sixes[i]); } } win[n] = !b; } return win

Conditional Compilation in assembler (.s) code for iPhone - how?

扶醉桌前 提交于 2019-12-29 07:17:10
问题 I have a few lines of assembler arm code in an .s file. Just a few routines i need to call. It works fine when building for the device, however when i switch to iPhone Simulator i get "no such instruction" errors. I tried to compile parts of the .s file conditionally with what i know: #if !TARGET_IPHONE_SIMULATOR But the assembler doesn't recognize these preprocessor directives (of course) and none of the conditional compilation techniques for assembler that i could remember or find worked,

Xcode 6 Beta not compiling

烈酒焚心 提交于 2019-12-29 06:44:29
问题 I've got the following problem: I've written my first Swift App (for iOS7) and it worked fine. After changing some minor detail (adding a string somewhere) it wouldn't compile anymore, even if I changed everything back how it was before. There is no error message or anything like it, it says that it's building the project (Compiling Swift Source Files) but it's not progressing at all, even after hours of "building". I've tried it with Xcode 6 b1 and b2 and with both it's the same: all the

How to render a dynamic template with components in Angular2

情到浓时终转凉″ 提交于 2019-12-29 05:19:05
问题 I've tried many stackoverflow options like Load existing components dynamically Angular 2 Final Release. What i want to do is get a html page with a ajax request and render/compile this template in my custom component. I've figured out that angular2 has two deprecated components and that i have to use ComponentFactoryResolver . In my old solution i could just set a '[innerHtml]' to render the HTML. Now i need a new solution. Who can help me out? page.component.ts import { Component, ViewChild

Compiler can't find Python.h

ぐ巨炮叔叔 提交于 2019-12-29 01:05:15
问题 I'm kinda new to C, and I can't seem to do what I want. I need to make some Python bindings for C functions, and I think I can figure this out. But there's one little line that WILL NOT WORK. #include <Python.h> I get this: fatal error #1035: Can't find include file <Python.h>. I've tried everything. I just stuck Python.h in the same folder as my project first. Then I put the file name in Library and Object files under linker. Then I did the same with python31.lib, then I put the directory

Java - When is it a compiler error and when is it a runtime exception?

风流意气都作罢 提交于 2019-12-28 18:44:40
问题 I am currently studying for the SCJP certification using the Sierra and Bates Study Guide and in many of the self tests (mock exam questions) I keep running into the same problem - I can't tell whether a particular error will be at runtime (an exception) or at compile (compile error). I know this is a bit of a vague question and that it might not be possible to answer but, how can I tell if an error will be found at compile or at runtime? Would you be able to send me some website links that

Intellij - set default output path to gradle output

半腔热情 提交于 2019-12-28 16:13:11
问题 So, I created a new gradle project, choosing Java as "additional libraries and frameworks". Gradle will compile to .\build\classes and maintain package structure, but the "module compile output path" in project structure -> modules is set to .\out\production\classes . That's really annoying and not something I want to remember having to change every time I create a new Java project. Can I somehow change the default so it matches the gradle output path? 回答1: You can use the Gradle pluigin for

how to compile multiple java files when there are java files in other packages

元气小坏坏 提交于 2019-12-28 10:06:23
问题 I am compiling multiple files in a directory (javac *.java) but I have a problem when I try to do this: I get compile errors saying that say javac cannot find a symbol of an object. I have multiple packages that contain java files that are needed to run the main program. But it seems that trying to compile these one by one won't work. It runs fine in my IDE but I'm interested in learning how it's done via Command Prompt. The main program is in the drivers folder. I have tried compiling the

Why this compile error

我怕爱的太早我们不能终老 提交于 2019-12-28 06:24:09
问题 Why if I write void Main() { string value = @"C:\"; if (!string.IsNullOrEmpty(value)) { string sDirectory = Path.GetDirectoryName(value); } } it compiles. And in case if I write void Main() { string value = @"C:\"; if (!string.IsNullOrEmpty(value)) string sDirectory = Path.GetDirectoryName(value); } It doesn't ? It's clear that from pure functional point of view the declaration of the variable in the second example is useless, but why it magically becomes usefull in first example, so ? The IL

Why this compile error

百般思念 提交于 2019-12-28 06:24:02
问题 Why if I write void Main() { string value = @"C:\"; if (!string.IsNullOrEmpty(value)) { string sDirectory = Path.GetDirectoryName(value); } } it compiles. And in case if I write void Main() { string value = @"C:\"; if (!string.IsNullOrEmpty(value)) string sDirectory = Path.GetDirectoryName(value); } It doesn't ? It's clear that from pure functional point of view the declaration of the variable in the second example is useless, but why it magically becomes usefull in first example, so ? The IL