compilation

Which javac.exe is used by ant javac task?

烈酒焚心 提交于 2019-12-01 22:29:45
问题 I am facing one problem. I renamed javac.exe on my machine and noticed that ant javac task still works fine. Does anybody know from where its getting javac.exe? 回答1: Actually, I believe, that by default Ant tries to execute the java compiler class directly with this code: try { Class c = Class.forName ("com.sun.tools.javac.Main"); Object compiler = c.newInstance (); Method compile = c.getMethod ("compile", new Class [] {(new String [] {}).getClass ()}); int result = ((Integer) compile.invoke

vb.net compile error 'abc' is ambiguous in the namespace 'xyz'

和自甴很熟 提交于 2019-12-01 22:19:10
问题 I have a VB.Net solution that another developer created and I'm trying to compile it on our build machine (it compiles on their machine) but with one of the projects I get an error saying something along the lines of: Imyinterface is ambiguous in the namespace anamespaceassembly . I have tried with no success: examined the references to see any obvious errors removed and re-added the assembly in question searched the system for the same dll attempted to compile the original deve's src (.v the

String concatenation in Python

大城市里の小女人 提交于 2019-12-01 22:10:29
问题 Can you describe difference between two ways of string concatenation: simple __add__ operator and %s patterns? I had some investigation in this question and found %s (in form without using parentheses) a little faster. Also another question was appeared: why result of 'hell%s' % 'o' refers to another memory region than 'hell%s' % ('o',) ? There is some code example: l = ['hello', 'hell' + 'o', 'hell%s' % 'o', 'hell%s' % ('o',)] print [id(s) for s in l] Result: [34375618400, 34375618400,

How to fix undefined references to inflate/deflate functions?

此生再无相见时 提交于 2019-12-01 21:17:47
I am trying to compile existing code provided in examples by zlib , but it is giving me error at the first place itself: nikhil@nikhil-Vostro-3500:~/zlib-1.2.8/examples$ gcc -o zpipe -g zpipe.c /tmp/ccVZzqsb.o: In function `def': /home/nikhil/zlib-1.2.8/examples/zpipe.c:32: undefined reference to `deflateInit_' /home/nikhil/zlib-1.2.8/examples/zpipe.c:40: undefined reference to `deflateEnd' /home/nikhil/zlib-1.2.8/examples/zpipe.c:51: undefined reference to `deflate' /home/nikhil/zlib-1.2.8/examples/zpipe.c:55: undefined reference to `deflateEnd' /home/nikhil/zlib-1.2.8/examples/zpipe.c:66:

Is C# considered a context free language?

人盡茶涼 提交于 2019-12-01 20:57:22
问题 I have been looking for this, but there is a lot of different answers to this question on the MSDN forums. Some people say that "All computer language grammars are context free" and others say that any language that has white-space sensitive syntax is likely context-sensitive and therefore not context-free (F# and Python). Whould be nice a definitive answer and maybe some proof. 回答1: I would describe C# as having a context-free grammar, but the language has context-sensitive rules that are

Which javac.exe is used by ant javac task?

只谈情不闲聊 提交于 2019-12-01 20:49:14
I am facing one problem. I renamed javac.exe on my machine and noticed that ant javac task still works fine. Does anybody know from where its getting javac.exe? Actually, I believe, that by default Ant tries to execute the java compiler class directly with this code: try { Class c = Class.forName ("com.sun.tools.javac.Main"); Object compiler = c.newInstance (); Method compile = c.getMethod ("compile", new Class [] {(new String [] {}).getClass ()}); int result = ((Integer) compile.invoke (compiler, new Object[] {cmd.getArguments()})) .intValue (); return (result == MODERN_COMPILER_SUCCESS); }

When using ld to link, undefined reference to '__main'

纵然是瞬间 提交于 2019-12-01 20:40:55
/* test.c */ void func1() { } int main() { func1(); } Hello, I am making kernel code using C. But I tested above code to know how to build C kernel code. Below command is what I gave to prompt. I am using MinGW on Windows 8.1. gcc -c -m32 test.c ld -o test -Ttext 0x00 -e _main test.o But this error was occurred from ld. test.o:test.c:(.text+0x7): undefined reference to `__main' So, I tried different way. add -nostdlib and --freestanding option to gcc. But the result was same. Is __main function in CRT0 ? What should I do to solve this problem.. ? 3442 The only viable way if you're really into

How eclipse execute java code when there are compile errors

依然范特西╮ 提交于 2019-12-01 20:16:45
When the following java code is executed in eclipse, it gives the correct output (i.e. prints 'Class B'), but according to java specification, the code cannot be compiled (since the super class constructor requires an int argument and the constructor provided by the compiler to class B includes a call to the super class no arg constructor, which is not defined), and when try to compile the file using javac command in command line, it only compiles the super class i.e. class A and fails with the following compile error: B.java:8: cannot find symbol symbol : constructor A() location: class A

vb.net compile error 'abc' is ambiguous in the namespace 'xyz'

爷,独闯天下 提交于 2019-12-01 20:12:51
I have a VB.Net solution that another developer created and I'm trying to compile it on our build machine (it compiles on their machine) but with one of the projects I get an error saying something along the lines of: Imyinterface is ambiguous in the namespace anamespaceassembly . I have tried with no success: examined the references to see any obvious errors removed and re-added the assembly in question searched the system for the same dll attempted to compile the original deve's src (.v the source control version) examined the assembly with ildasm.exe I usually code in C# and have not seen

C order of evaluation of assignment statement

有些话、适合烂在心里 提交于 2019-12-01 19:49:53
问题 I've been encountered on a case where cross-platform code was behaving differently on a basic assignment statement. One compiler evaluated the Lvalue first, Rvalue second and then the assignment. Another compiler did the Rvalue first, Lvalue second and then the assignment. This may have impact in case Lvalue influence the value of Rvalue as shown in the following case: struct MM { int m; } int helper (struct MM** ppmm ) { (*ppmm) = (struct MM *) malloc (sizeof (struct MM)); (*ppmm)->m = 1000;