compilation

What are the stages of compilation of a C++ program?

我是研究僧i 提交于 2019-12-17 15:34:07
问题 Are the stages of compilation of a C++ program specified by the standard? If so, what are they? If not, an answer for a widely-used compiler (I'd prefer MSVS) would be great. I'm talking about preprocessing, tokenization, parsing and such. What is the order in which they are executed and what do they do in particular? EDIT: I know what compilation, linking and preprocessing do, I'm mostly interested in the others and the order. Explanations for these are, of course, also welcomed since I

Can I use Qt without qmake or Qt Creator?

僤鯓⒐⒋嵵緔 提交于 2019-12-17 15:34:06
问题 I want to program using Qt, but I don't want to use special compilers or IDE such as Qt Creator and qmake. I want to write with Kate and compile with g++. Can I compile a program that uses Qt with g++? How do I compile it with g++? 回答1: Sure you can. Although it is more convenient with qmake or CMake, you can do: CXXFLAGS += -Ipath_to_your_qt_includes LDFLAGS += -Lpath_to_your_qt_libs LDLIBS += -lqt-mt (for Qt3) or LDLIBS += -lQtCore -lQtGui (for Qt4, add what you need) my_prog: my_prog.cpp

What are the benefits of a directive template function in Angularjs?

主宰稳场 提交于 2019-12-17 15:25:02
问题 According to the documentation a template can be a function which takes two parameters, an element and attributes and returns a string value representing the template. It replaces the current element with the contents of the HTML. The replacement process migrates all of the attributes and classes from the old element to the new one. The compile function deals with transforming the template DOM. It takes three parameters, an element , attributes and transclude function. The transclude

Compile error: package javax.servlet does not exist

纵然是瞬间 提交于 2019-12-17 15:24:09
问题 I have a package in which I import javax.servlet.* and javax.servlet.http.* When I try to compile it in command prompt I get the error package javax.servlet does not exist I use JDK 1.7.0 and Tomcat 6.0. 回答1: You need to add the path to Tomcat's /lib/servlet-api.jar file to the compile time classpath. javac -cp .;/path/to/Tomcat/lib/servlet-api.jar com/example/MyServletClass.java The classpath is where Java needs to look for imported dependencies. It will otherwise default to the current

How to watch and compile all TypeScript sources?

醉酒当歌 提交于 2019-12-17 15:08:48
问题 I'm trying to convert a pet project to TypeScript and don't seem to be able to use the tsc utility to watch and compile my files. The help says I should use the -w switch, but it looks like it can't watch and compile all *.ts files in the some directory recursively. This seems like something tsc should be able to handle. What are my options? 回答1: Create a file named tsconfig.json in your project root and include following lines in it: { "compilerOptions": { "emitDecoratorMetadata": true,

Turning .NET executable into native executable

旧街凉风 提交于 2019-12-17 10:44:13
问题 Is there any approach to convert an application developed in .NET into a native executable (sources are included)? Installing the whole framework (up to .NET Framework 3.5 SP1) takes a lot of time - not always the computers are updated from the internet. Is it possible to call NGen in order to produce independent executables? Thanks 回答1: It's not available yet, but the Mono project team are working on an Ahead of Time compiler that will do what you are looking for. The intention is for Mono

TypeScript “Compile on save” feature not working in Visual Studio 2015

送分小仙女□ 提交于 2019-12-17 10:37:06
问题 The "Compile on save" feature isn't working for me after upgrading to Visual Studio 2015. When I make a change to a .ts file in my project and save, the status bar at the bottom of the IDE says Output(s) generated successfully , but the generated .js file doesn't change. Here's what I've tried: adding the following to the root <Project> element in my .csproj : <PropertyGroup> <TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled> </PropertyGroup> checking and unchecking the

Compiling external .java files from within Java

时光总嘲笑我的痴心妄想 提交于 2019-12-17 09:50:35
问题 I am making a tool that will write .java files, then (hopefully) compile those files to .class files. All in one process, the user selects a file directory where multiple .java files are written. Now I want the program to compile these Java files. 回答1: JavaCompiler is your friend. Check the documentation here And here an example on how you could use the compiler API JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); DiagnosticCollector<JavaFileObject> diagnostics = new

Java static final values replaced in code when compiling?

笑着哭i 提交于 2019-12-17 09:42:15
问题 In java, say I have the following ==fileA.java== class A { public static final int SIZE = 100; } Then in another file i use this value ==fileB.java== import A; class b { Object[] temp = new Object[A.SIZE]; } When this gets compiled does SIZE get replaced with the value 100, so that if i were to down the road replace the FileA.jar but not FileB.jar would the object array get the new value or would it have been hardcoded to 100 because thats the value when it was originally built? Thanks,

Java static final values replaced in code when compiling?

≡放荡痞女 提交于 2019-12-17 09:41:45
问题 In java, say I have the following ==fileA.java== class A { public static final int SIZE = 100; } Then in another file i use this value ==fileB.java== import A; class b { Object[] temp = new Object[A.SIZE]; } When this gets compiled does SIZE get replaced with the value 100, so that if i were to down the road replace the FileA.jar but not FileB.jar would the object array get the new value or would it have been hardcoded to 100 because thats the value when it was originally built? Thanks,