compilation

How to move main method to another class in Scala?

早过忘川 提交于 2019-12-05 02:36:25
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 main class. I tried to run it with such result: MainApp main method should be static I am completely

Static analysis for partial C++ programs

三世轮回 提交于 2019-12-05 02:04:08
问题 I'm thinking about doing some static analysis project over C++ code samples , as opposed to entire programs. In general static analysis requires some simpler intermediate representation, but such a representation cannot be accurately created without the entire program code. Still, I know there is such a tool for Java - it basically "guesses" missing information and thus allows static analysis to take place even though it's no longer sound or complete. Is there anything similar that can be

Compile drools guided decision table into rules

点点圈 提交于 2019-12-05 01:32:50
I am wondering how I could use a guided decision table from the Drools Workbench inside a Java application using the drools runtime. The idea is that a user would work defining rules, processes and some decision tables in the workbench, which will be picked up by the drools runtime. Still, for some reason, I can't figure out how to execute this in drools, since it stored the table as a gdst file and it does not seem to compile to drools. With drools, is there a way to: - execute the gdst file as I would with an excel decision table? - or compile a gdst file in rules? I've been looking for a

Module packages not found at compile time in IntelliJ

为君一笑 提交于 2019-12-05 01:23:39
I'm attempting to setup my Android project in IntelliJ. I've never used it before, and I'm having some problems with module dependencies. The project depends on several modules, which I have added in the Dependencies tab. IntelliJ detects them (i.e. there are no complaints in the code), but it fails at compile time with "package x.y.z does not exist." I have also tried checking "export" for the modules, but that seems to have no effect. I saw this question which appears to be the same problem, but there was no solution. Try adding your src as modules. File > Add Module Create Module from

Get the commands distutils passes to the compiler

落爺英雄遲暮 提交于 2019-12-05 01:19:53
Lets say I have this Python code in a setup.py script to build a C extension: from distutils.core import setup, Extension module1 = Extension('demo', sources = ['demo.c']) setup (name = 'PackageName', version = '1.0', description = 'This is a demo package', ext_modules = [module1]) Easy enough. Now I call the setup.py script with this line: C:/> python setup.py build_ext --compiler=mingw32 Ok, but whats the question? When distutils calls mingw32 and passes all the necessary and operating system independant flags and options to it, how does it figure those flags out? Where does distutils keep

Why do we need to compile for different platforms (e.g. Windows/Linux)?

我的未来我决定 提交于 2019-12-05 01:13:16
问题 I've learned the basics about CPUs/ASM/C and don't understand why we need to compile C code differently for different OS targets. What the compiler does is create Assembler code that then gets assembled to binary machine code. The ASM code of course is different per CPU architecture (e.g. ARM) as the instruction set architecture is different. But as Linux and Windows run on the same CPU, the machine operations like MOVE/ADD/... should be identical. While I do know that there are OS-specific

gem install mysql: Failed to build gem native extension (Mac Lion)

谁都会走 提交于 2019-12-05 01:09:56
问题 I installed MySQL 5.5.27 for Mac OS X Lion (from .dmg). Now i try to install the mysql gem: $ gem install mysql Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /Users/serg/.rvm/rubies/ree-1.8.7-head/bin/ruby extconf.rb checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query()

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

混江龙づ霸主 提交于 2019-12-05 00:39:08
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 this error: In file included from /usr/src/linux-headers-3.0.0-17-generic/include/linux/kernel.h:13:0,

Android build failure

浪子不回头ぞ 提交于 2019-12-05 00:28:10
问题 I followed instructions from here. After $ repo sync I tried to build it with $ make , but got this error: host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so) /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.so when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.4.3/../../../libz.a when searching for -lz /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz /usr/bin/ld: skipping

How to merge multiple Arrays without slowing the compiler down?

半城伤御伤魂 提交于 2019-12-05 00:23:03
问题 Adding this line of code causes my compile time to go from 10 seconds to 3 minutes. var resultsArray = hashTagParticipantCodes + prefixParticipantCodes + asterixParticipantCodes + attPrefixParticipantCodes + attURLParticipantCodes Changing it to this brings the compile time back down to normal. var resultsArray = hashTagParticipantCodes resultsArray += prefixParticipantCodes resultsArray += asterixParticipantCodes resultsArray += attPrefixParticipantCodes resultsArray +=