compilation

How to move main method to another class in Scala?

笑着哭i 提交于 2020-01-02 01:21:10
问题 IntelliJ IDEA 10.5 (probably this matters). I am new to Scala, so I started in an akward way. I created one file with two classes -- empty MainApp and another class, HelloWorld with method main. I compiled it and executed -- IntelliJ automatically detected HelloWorld as main class. It was OK. Then, I moved main method to MainApp, and deleted (then empty) HelloWorld class. When I tried to run it, IntelliJ sticked to HelloWorld nevertheless. So I reconfigured project and selected MainApp as

error compiling: linux/module.h: No such file or directory

泪湿孤枕 提交于 2020-01-02 00:56:10
问题 I've written a simple module: #define __KERNEL__ #define MODULE #include <linux/kernel.h> #include <linux/module.h> int init_module(void) { printk("Hello, world\n"); return 0; } void cleanup_module(void) { printk("Goodbye\n"); } and compiling it with this command: cc -c hello.c but I'm getting this error: linux/module.h: No such file or directory any suggestions? EDIT: I used this commad: cc -I/usr/src/linux-headers-3.0.0-17-generic/include -c hello.c and it goes one step ahead, now I get

Does undefined behavior really help modern compilers to optimize generated code?

拜拜、爱过 提交于 2020-01-01 17:27:07
问题 Aren't modern compilers smart enough to be able to generate a code that is fast and safe at the same time? Look at the code below: std::vector<int> a(100); for (int i = 0; i < 50; i++) { a.at(i) = i; } ... It's obvious that the out of range error will never happen here, and a smart compiler can generate the next code: std::vector<int> a(100); for (int i = 0; i < 50; i++) { a[i] = i; } // operator[] doesn't check for out of range ... Now let's check this code: std::vector<int> a(unknown

how to dynamically compile a ashx file?

一曲冷凌霜 提交于 2020-01-01 15:49:11
问题 I have a ashx file in a asp.net web project. It has a code behind cs file. The cs file is compiled into project dll & deployed to production. I found no way to dynamically change the cs file without deploying the whole project dll. I have been putting c# code into aspx (not .cs) file, after deployment, I can make change to a single aspx file, and deploy, IIS can dynamically compile & merge with its code behind c# code. Can I do the similar thing with ashx file? Here is a quote from MSDN. http

How to compile C# for multiple processor machines? (With VS 2010 or csc.exe)

独自空忆成欢 提交于 2020-01-01 14:44:28
问题 Greetings! I've searched for compiler (csc.exe) options at MSDN and I found an answer here, at Stackoverflow, about compiling with multiple processors. But my problem is about compiling for multiple processors, as follows. The university where I'm graduating has a 11 machine cluster (which has 6 quad-cores and 5 four-core bi-processed machines). It runs under linux, but I can install MONO there. And instead of compiling with multiple processors or cores, I want to compile for multiple

Compile check if compiling as static library

落爺英雄遲暮 提交于 2020-01-01 09:21:48
问题 How can i check at compilation if the project is being compiles as a lib ? (static library) Is there some kind of static assert or some other flag i can check? I can't add a preprocessor variable myself, because it's a utility that will be used in other projects across the company. So I'm wondering if there's some preprocessor flag that is is being sent by default or something. I'm using Visual Studio 2010 回答1: There is no such thing in predefined macro list - http://msdn.microsoft.com/en-us

Can Visual Studio 2010 automatically copy a compiled file to another directory?

旧街凉风 提交于 2020-01-01 08:13:12
问题 I have two projects, one VB6 project which compiles to an EXE and one MSVC++2010 project which compiles to a DLL. The DLL needs to be in the same folder as the EXE file in order to work. Can I have Visual Studio 2010 automatically copy the compiled DLL to the VB6 project folder after a compilation? 回答1: The easiest way to set this up is to use a post build event. These run once a build is successfully completed and has a set of handy macros to make access to common outputs, like compiled

dynamic code compilation

。_饼干妹妹 提交于 2020-01-01 05:50:07
问题 I'm working on a program that renders iterated fractal systems. I wanted to add the functionality where someone could define their own iteration process, and compile that code so that it would run efficiently. I currently don't know how to do this and would like tips on what to read to learn how to do this. The main program is written in C++ and I'm familiar with C++. In fact given most of the scenarios I know how to convert it to assembly code that would accomplish the goal, but I don't know

How to programmatically build a visual studio solution?

你说的曾经没有我的故事 提交于 2020-01-01 05:13:26
问题 I would like to compile a solution by passing the solution file path (.sln file) and the build mode (debug, release). I do not want to call a command line process like devenv.exe or msbuild.exe, instead I would like to use an API and know if there were compile errors. Is it possible ? Please provide samples if you think you know how to do that. 回答1: You're going to have to launch a process at some point to do the compilation you might as well spawn a process to kick off the compilation. It is

How to programmatically build a visual studio solution?

。_饼干妹妹 提交于 2020-01-01 05:13:07
问题 I would like to compile a solution by passing the solution file path (.sln file) and the build mode (debug, release). I do not want to call a command line process like devenv.exe or msbuild.exe, instead I would like to use an API and know if there were compile errors. Is it possible ? Please provide samples if you think you know how to do that. 回答1: You're going to have to launch a process at some point to do the compilation you might as well spawn a process to kick off the compilation. It is