compilation

What is “object” in “object file” and why is it called this way? [duplicate]

China☆狼群 提交于 2019-12-03 01:42:40
This question already has an answer here: What's an object file in C? 5 answers I was asked a question: "What is an 'object file'?". After looking at Wiki , I only know that it contains objects . But what are those objects and why someone called them that way? Object files (or object code) are machine code files generated by a compiler from source code. The difference with an executable is that the object file isn't linked, so references to functions, symbols, etc aren't defined yet (their memory addresses is basically left blank). When you compile a C file with GCC: gcc -Wall -o test test.c

Understanding STG

 ̄綄美尐妖づ 提交于 2019-12-03 01:37:56
问题 The design of GHC is based on something called STG, which stands for "spineless, tagless G-machine". Now G-machine is apparently short for "graph reduction machine", which defines how laziness is implemented. Unevaluated thunks are stored as an expression tree, and executing the program involves reducing these down to normal form. (A tree is an acyclic graph, but Haskell's pervasive recursion means that Haskell expressions form general graphs , hence graph-reduction and not tree-reduction.)

How to fix error with xml2-config not found when installing PHP from sources?

橙三吉。 提交于 2019-12-03 01:23:36
问题 When I try to install php 5.3 stable from source on Ubuntu (downloading compressed installation file from http://www.php.net/downloads.php) and I run ./configure I get this error: configure: error: xml2-config not found. Please check your libxml2 installation. 回答1: All you need to do instal install package libxml2-dev for example: sudo apt-get install libxml2-dev On CentOS/RHEL: sudo yum install libxml2-devel 回答2: For the latest versions it is needed to install libxml++2.6-dev like that: apt

Java: Cannot find symbol? [duplicate]

喜你入骨 提交于 2019-12-03 00:14:41
问题 This question already has answers here : What does a “Cannot find symbol” or “Cannot resolve symbol” error mean? (13 answers) Closed last month . When I try to compile a small program I wrote that builds an array of a deck of cards and prints them, I get 6 errors all of which are "cannot find symbol" errors. Can somebody check my code and find the mistakes please? Thanks. Compile Output: sudhakar@sudhakar-Dell-DXP061 ~/deck $ javac doDeck.java Deck.java Card.java doDeck.java:7: cannot find

Given the state of the stack and registers, can we predict the outcome of printf's undefined behavior

試著忘記壹切 提交于 2019-12-02 23:54:56
问题 Here is some simple C code for a class quiz: #include <stdio.h> int main() { float a = 2.3; printf("%d\n", a); return 0; } Compiled and run on: Apple LLVM version 6.1.0 ( clang-602.0.53 ) (based on LLVM 3.6.0svn) Target: x86_64 -apple-darwin14.5.0 The output of this code is undefined . I am trying to predict the output by inspecting the memory near a with the debugger ( X command in gdb). For example, when the address of a is 0x7fff5fbffb98 , then the context near &a is as follows:

What should I change to make this file compile?

旧巷老猫 提交于 2019-12-02 23:41:25
问题 I am in a programming class and this program is part of my homework. This file analyzes data from a file called "Names.txt" and then prints the information. I'm getting compilation errors and I want to know what I need to change or add to make it compile successfully. Here is my code: import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; public class NameApp { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); String selection,

Eval-when uses?

删除回忆录丶 提交于 2019-12-02 23:30:30
After reading a lot of documentation regarding Lisp eval-when operator I still can't understand its uses, I know with this operator I can control the evaluation time of my expressions but I can't figure out any example where this may be applicable ? Best Regards, utxeee. Compilation of a Lisp file Take for example the compilation of a Lisp file. The Lisp compiler processes the top-level forms. These can be arbitrary Lisp forms, DEFUNs, DEFMACROS, DEFCLASS, function calls,... The whole story how the file compiler works is too complex to explain here, but a few things: the file compiler

what is the difference between linking and loading in c language

前提是你 提交于 2019-12-02 23:12:59
Does linking and loading of the the dynamic libraries both happen at runtime? or is it that only loading of the library happens at run time? See the earlier very good point about the distinction between static linking and dynamic linking. Assuming you are referring to the dynamic linking, then: Both loading and (dynamic) linking are done by the linker – on linux and other Unix-alikes this is done by /lib/ld.so , which is the actual program that is launched by the operating system in almost all cases. ld.so in turn loads your application - mygameBinary into memory, and ld.so then reads from the

How to remove strings from a compiled binary (.so)

ぐ巨炮叔叔 提交于 2019-12-02 22:58:12
How do I remove strings from / obfuscate a compiled binary? The goal is to avoid having people read the names of the functions/methods inside. It is a dynamic library (.so) compiled from C++ code for Android with the NDK tools (includes GCC) I compile with -O3 and already use arm-eabi-strip -g mylib.so to remove debugging symbols, but when I do strings mylib.so all the names of the functions/methods are still readable. These strings are in the dynamic symbol table , which is used when the library is loaded at runtime. readelf -p .dynstr mylib.so will show these entries. strip -g will remove

Compiling PHP with GD and libjpeg support

坚强是说给别人听的谎言 提交于 2019-12-02 22:30:35
I compile my own PHP, partly to learn more about how PHP is put together, and partly because I'm always finding I need modules that aren't available by default, and this way I have control over that. My problem is that I can't get JPEG support in PHP. Using CentOS 5.6. Here are my configuration options when compiling PHP 5.3.8 : './configure' '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-gd' '--with-curl' '--with-mcrypt' '--with-zlib' '--with-pear' '--with-gmp' '--with-xsl' '--enable-zip' '--disable-fileinfo' '--with-jpeg-dir=/usr/lib/' The ./configure output says: