compilation

Tail Call Optimisation in Java

旧街凉风 提交于 2019-12-30 17:24:08
问题 As of Java 8 , Java does not provide Tail-Call Optimization (TCO). On researching about it, I came to know the reason which is: in jdk classes [...] there are a number of security sensitive methods that rely on counting stack frames between jdk library code and calling code to figure out who's calling them. However Scala , which is based on JVM has support for Tail-Call Optimisation. Scala does tail recursion optimisation at compile-time . Why can't Java use the same approach ? PS: Not sure

How to integrate/install latest c++ protobuf (3.2) with Android NDK?

无人久伴 提交于 2019-12-30 11:14:09
问题 The earlier protobuf version 3.0 was easily integrated. But there are issues with the latest version 3.2. It simply compiles & builds all the un-related Android .cc file components as well. If we follow the path to latest branch in git for c++ proto & build it as per the steps, then it generates 15 MB .SO file, unlike earlier which was ~1-2 MB. How to optimally integrate latest protobuf to Android? 回答1: Using cross platform Android Standalone Tool chain and provided build script may result in

How to integrate/install latest c++ protobuf (3.2) with Android NDK?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-30 11:14:05
问题 The earlier protobuf version 3.0 was easily integrated. But there are issues with the latest version 3.2. It simply compiles & builds all the un-related Android .cc file components as well. If we follow the path to latest branch in git for c++ proto & build it as per the steps, then it generates 15 MB .SO file, unlike earlier which was ~1-2 MB. How to optimally integrate latest protobuf to Android? 回答1: Using cross platform Android Standalone Tool chain and provided build script may result in

Debugging information in GCC preprocessor output

狂风中的少年 提交于 2019-12-30 10:44:55
问题 I was inspecting the preprocessed output generated by GCC, and I see a lot of these in the .i file that I generated using the -save-temps flag: # 8 "/usr/include/i386-linux-gnu/gnu/stubs.h" 2 3 4 What do the numbers before and after the absolute path of stubs.h mean? It seems to be some kind of debugging information that is inserted by the preprocessor and allows the compiler to issue error messages referring to this information. These lines do not affect the program itself, but what

Where do the compiler and assembler reside on a computer?

旧巷老猫 提交于 2019-12-30 09:41:50
问题 So I know the very basics, that a compiler turns source code into assembly code and an assembler turns assembly code into machine code. What I haven't been able to google properly though, is where are they actually located? I'm assuming that the compiler is just somewhere on the hard drive since you can download compilers from the web and use them for various programming languages. Is the assembler located on the hard drive, built into the operating system, or somewhere in the actual CPU? Is

c# change framework error

旧街凉风 提交于 2019-12-30 09:29:13
问题 I am running Visual Studio 2010. I just change the frame work of my project from 4.0 to 3.5. I removed the reference Microsoft.Framework that it asked me to remove then tried to compile. I now get the error: Error 1 Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Line 123, position 5. C:\Users\\Documents\Visual Studio 2010\Projects\\\Properties\Resources

Why should the Java compiler not support inheritance of imports?

半城伤御伤魂 提交于 2019-12-30 08:49:49
问题 In Java, imports are related to an (outer) class, as every (outer) class is supposed to be coded in a separate file. Thus, one could claim that the import ...; directives before a class definition are associated with the class (somewhat like annotations are). Now, if one could inherit a parent class' imports, that would greatly reduce the clutter of source files. Why should this not be possible? i.e. why should the Java compiler not consider also the imports of base classes? Notes: There's

java in-memory compilation

时光毁灭记忆、已成空白 提交于 2019-12-30 08:10:10
问题 How can i generate bytecode (Byte[]) from a String at runtime, without using a "javac" process or something of this sort? is there a simple way of calling the compiler like that? later addition: I chose to accept the solution that actually best fits my situation. my application is a hobby-project still in design sketch phase, and it is the right time to consider inserting new technology. also, since the guy that's supposed to help me with BL is a JavaScript developer, the idea of using a

java in-memory compilation

倖福魔咒の 提交于 2019-12-30 08:10:03
问题 How can i generate bytecode (Byte[]) from a String at runtime, without using a "javac" process or something of this sort? is there a simple way of calling the compiler like that? later addition: I chose to accept the solution that actually best fits my situation. my application is a hobby-project still in design sketch phase, and it is the right time to consider inserting new technology. also, since the guy that's supposed to help me with BL is a JavaScript developer, the idea of using a

lib curl symbol not found

痴心易碎 提交于 2019-12-30 06:12:05
问题 Really stupid C question. I'm trying to build the source code here so I can start on modifying it for myself http://curl.haxx.se/libcurl/c/ftpget.html I download the file, then run gcc -o test ftpget.c and get Undefined symbols: "_curl_global_init", referenced from: _main in ccFchguB.o "_curl_easy_perform", referenced from: _main in ccFchguB.o "_curl_easy_setopt", referenced from: _main in ccFchguB.o _main in ccFchguB.o _main in ccFchguB.o _main in ccFchguB.o "_curl_easy_cleanup", referenced