compilation

Javac is not found

拜拜、爱过 提交于 2019-12-03 19:03:14
问题 I'm running Windows 8 and I can not get javac to work. I have set my PATH in environmental variables to C:\Program Files (x86)\Java\jdk1.7.0_17\bin I have tried both with and without ';' but to no avail. I recently had this issue on my desktop and adding ; worked but it's not in this case. I have made sure that javac does exist in the bin too. Any suggestions on fixes would be greatly appreciated. EDITS echo %PATH% gives: C:\Users\Arktri\Desktop>echo %PATH% C:\Program Files (x86)\Intel\iCLS

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

非 Y 不嫁゛ 提交于 2019-12-03 17:36:02
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 functions like printing to a terminal, this functionality could be provided by different implementations

When do C and C++-compilers convert or promote a float to double, implicitly?

不羁的心 提交于 2019-12-03 17:18:29
For an embedded project I'd like to know when does a standard-compliant C-compiler (C99) and C++-compiler (C++11) will most likely implicitly promote a single-float variable/value to double-float. I'm aware of two cases: literals which are not suffixed with f . For example: 3.14 passing a float to function with variadic argument-list ( ... ) Are there any others? What about templates? The answers of this question are very helpful for me as well - including it here for reference. M.M In C: A numeric literal with . and no suffix, e.g. 3.14 , does not involve any promotion. It is double for its

IntelliJ Idea not generate id in R.java

不打扰是莪最后的温柔 提交于 2019-12-03 17:12:00
问题 I recently switched to IntelliJ Idea 12. Now created a project on android and immediately ran into a problem: not generated id in R.java Rebuild project does not help. Maybe in IntelliJ Idea have any subtlety is not known to me? error: 12-01 16:08:15.067: ERROR/AndroidRuntime(7108): FATAL EXCEPTION: main android.content.res.Resources$NotFoundException: String resource ID #0x1 at android.content.res.Resources.getText(Resources.java:266) at android.widget.TextView.setText(TextView.java:3624) at

How to merge multiple Arrays without slowing the compiler down?

非 Y 不嫁゛ 提交于 2019-12-03 17:03:19
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 += attURLParticipantCodes Why does the first line cause my compile time to slow down so drastically and is there a more elegant

Tomcat JSP page not compiling (java.io.IOException: tmpFile.renameTo(classFile) failed)

亡梦爱人 提交于 2019-12-03 16:59:13
问题 Each time I run my web application on TomCat it gives me an error. There is nothing wrong with the .jsp files, just that I have to restart the server and sometimes the complete IDE for this error to go away. The error is the following Mar 12, 2014 5:57:01 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [jsp] in context with path [/Assignment_1_Flight_Reservation_System] threw exception [Unable to compile class for JSP] with root cause java.io

How to compile GnuTLS

流过昼夜 提交于 2019-12-03 16:32:13
问题 I'm trying to compile GnuTLS library several times on Centos 6.2 but with no luck. These are the steps: I downloaded Nettle 2.4 [root@localhost opt]# wget http://www.lysator.liu.se/~nisse/archive/nettle-2.4.tar.gz [root@localhost nettle-2.4]# tar zxvf nettle-2.4.tar.gz [root@localhost nettle-2.4]# cd nettle-2.4 [root@localhost nettle-2.4]# ./configure --enable-shared --prefix=/usr Version: nettle 2.4 Host type: x86_64-unknown-linux-gnu ABI: 64 Assembly files: x86_64 Install prefix: /usr

Convincing Swift that a function will never return, due to a thrown Exception

纵然是瞬间 提交于 2019-12-03 16:32:12
问题 Because Swift does not have abstract methods, I am creating a method whose default implementation unconditionally raises an error. This forces any subclass to override the abstract method. My code looks like this: class SuperClass { func shouldBeOverridden() -> ReturnType { let exception = NSException( name: "Not implemented!", reason: "A concrete subclass did not provide its own implementation of shouldBeOverridden()", userInfo: nil ) exception.raise() } } The problem: Because the function

Static analysis for partial C++ programs

穿精又带淫゛_ 提交于 2019-12-03 16:24:25
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 used to convert partial C++ code into some intermediate form (e.g. LLVM bytecode)? Ira Baxter As a general

How to compile C and Gtk+ with GCC on Linux?

寵の児 提交于 2019-12-03 16:09:07
I've searched and searched but I'm not getting the information I really want. Can someone please explain, as completely and fundamentally as possible, how Gtk+ code is compiled when writing in C, using GCC, on Linux. There's things like backticks, "c99", and .o files that I don't understand at all. I'd also appreciate any resources for learning Gtk+ code. All the sources I've found are for versions 2.x, but I think 3.6 is the current version. I'd like to reiterate, I'm only interested in C code. Please don't try explaining to me the benefits of C++ or C#, I've read all of them. I'm here for C.