compilation

compile directly from vim

和自甴很熟 提交于 2019-12-02 18:47:32
I'd like to compile cpp file w/o turning off vi. I know the :!g++ file.cpp but I prefer :make so I added this line in .vimrc file au FileType C set makeprg=gcc\ % au FileType Cpp set makeprg=g++\ % but I keep getting "make: ***** No targets specified and no makefile found. Stop.** "message. can anyone tell me what is wrong with my setting? I use to compile successfully with the option above. You need the substitution there, try something like: set makeprg=gmake\ %:r.o Oh, this assumes that you've got: a (M|m)akefile in the directory, or default SUFFIX rules are available for your environment

How does IIS know if it's serving a Web Site or a Web Application project?

限于喜欢 提交于 2019-12-02 18:27:44
I understand that Web Site Projects compile source on-the-fly, and Web Application Projects pre-compile source into a DLL (much like ASP.Net 1.x). But how is the difference specified in IIS? I know that Visual Studio knows -- there are different projects for each, etc. But the running instance (IIS + Framework) has to know which compilation model is being used, right? Because how else does it know whether or not to compile on-the-fly? A request comes in, hits an ASPX file...and how does the process know whether the associated CS file needs to be compiled (Web Site), or if it was already done

when is AOP code executed

天大地大妈咪最大 提交于 2019-12-02 18:22:46
问题 I have read some articles about AOP and it looks like a very interesting and powerful tool. But what about performance? For example, what if I create an aspect attribute called MyMethodAspect . It would do a simple thing - on the start of exucting method with that attribute is called a code contained in my MyMethodAspect class. For example write a line of text - 'starting...' thats the basic example - but what if the logic executed on starting the method is much more difficult. Can I

npm with node-sass and autoprefixer

有些话、适合烂在心里 提交于 2019-12-02 18:22:07
I use node-sass to compile all my Sass files to a master.css. This works well but now I want to add prefixes. I would like to use only the npm, no Gulp or Grunt. Here my package.json file: { "name": "xxxxxx.com", "version": "1.0.0", "description": "", "watches": { "sass": "src/scss/**" }, "scripts": { "sass": "node-sass src/scss/master.scss -o dist/css/ --style compressed", "prefix": "postcss --use autoprefixer dist/css/master.css -d dist/css/master.css", "dev": "rerun-script" }, "author": "Jan", "license": "ISC", "devDependencies": { "autoprefixer": "^6.3.1", "browserify": "^13.0.0", "clean

How to make a makefile only for compiling some java files?

安稳与你 提交于 2019-12-02 18:17:01
问题 I have three java files named A.java, B.java, C.java, A will create object B, B will create object C. But I have never built a makefile before. Does anyone can help me build a makefile just to compile these three java files? And what tool should I use to make a makefile? Thank you! 回答1: Define your suffixes. Define how to turn .java into .class Define what classes you want Define an "all" target. You don't need any specific editor for making a makefile; even Notepad would do. 来源: https:/

pretty print makefiles

我的未来我决定 提交于 2019-12-02 18:16:01
The linux kernel (and various other projects including git) have very nice makefiles that hide the giant cc calls into nice little acronyms. For example: gcc -O2 -o cool.o cool.c -llib gcc -O2 -o neat.o neat.c -llib would become: CC cool.c CC neat.c Which is really nice if you have a project with a large number of files and long compiler flags. I recall that this had to do with suppressing the default output and making a custom one. How do you do it? You can prepend @ to calls in the makefile targets. E.g.: %.o: %.c @$(CC) $(CFLAGS) -c -o $@ $< @echo "CC $<" For a much more complicated

How to speed up Linux kernel compilation?

微笑、不失礼 提交于 2019-12-02 18:15:31
I have core i5 with 8gb RAM. I have VMware workstation 10.0.1 installed on my machine. I have fedora 20 Desktop Edition installed on VMware as guest OS. I am working on Linux kernel source code v 3.14.1. I am developing an I/O scheduler for Linux kernel. After any modifications in code every time it takes around 1 hour and 30 minutes for compiling and installing the whole kernel code to see the changes. Compilation and Installation commands: make menuconfig , make , make modules , make modules_install , make install So my question is it possible to reduce 1 hour and 30 minutes time into only

Why does compiling over 100,000 lines of std::vector::push_back take a long time?

拟墨画扇 提交于 2019-12-02 18:15:06
I'm compiling a C++ library which defines a single function that randomly samples from a set of data points. The data points are stored in a std::vector . There are 126,272 std::vector push_back statements, where the vector in question is of type double . It is taking a long time to compile. Why would this take so long? (All the code other than the std::vector push_back statements would take less than 1 second to compile, because there's very little other code.) osgx There is the -ftime-report option in gcc which prints the detailed report of time wasted by each compiler phase. I'm used ubuntu

compilation error on boolean expression

落爺英雄遲暮 提交于 2019-12-02 18:03:06
问题 This is a snippet of Java code: static boolean a; // gets false static boolean b; static boolean c; public void printA(){ boolean bool = (a = true) || (b = true) && (c = true); System.out.print(a + ", " + b + ", " + c); } It does not compile, what is the prob? Error: multiple markers on this line; syntax error on the line of 'bool' variable. I expect it to print true, false, true . Although according to my tutorial books it prints true, false, false . I understand it performs short-circuiting

Why use #if 0 for block commenting out?

谁说我不能喝 提交于 2019-12-02 18:01:36
Reverse engineering code and I'm kind of appalled at the style, but I wanted to make sure there's no good reason for doing these things.... Is it just me or is this a horrible coding style if ( pwbuf ) sprintf(username,"%s",pwbuf->pw_name); else sprintf(username,"%d",user_id); And why wrap code not intended for compilation in an #if 0 .... #endif Instead of comments? EDIT: So as some explained below, this is due to the possibility to flummox /* */ which I didn't realize. But I still don't understand, why not just use your programming environment tools or favorite text editor's macro's to block