compilation

Why was the addition of trailing-return-types necessary in C++11?

半城伤御伤魂 提交于 2019-12-04 18:14:19
问题 I've finally started to read up on c++11 and I fail to understand why trailing-return-types are required. I came across the following example, which is used to highlight the problem: template<class Lhs, class Rhs> decltype(lhs+rhs) adding_func(const Lhs &lhs, const Rhs &rhs) {return lhs + rhs;} The example is illegal, because decltype(lhs+rhs) does not work, since the identifiers lhs and rhs are only valid after the parsing phase. I guess my question is about the timing of decltype type

rake assets:precompile throws Sass::SyntaxError: Invalid CSS after “*/”

一曲冷凌霜 提交于 2019-12-04 17:55:05
问题 I hope this isn't a duplicate problem; I've tried other solutions on SO with no effect When pushing my app to Heroku, the push has failed because application.css has not been able to compile. My terminal output: Running: rake assets:precompile rake aborted! Sass::SyntaxError: Invalid CSS after " */": expected selector, was "@font-face" (in /tmp/build_17e92975-ae8d-446f-8678-110eeeccfb64/app/assets/stylesheets/adminsite/application.css) (sass):1845 Attempts at solution I've searched and

Compile PHP into Static Binary

别说谁变了你拦得住时间么 提交于 2019-12-04 17:45:31
问题 I need to run a php script on a system with a somewhat broken PHP install. Rather than trying to workaround the issues I want to just package my code with it's own PHP binary (I can execute an executable). I want to just have a simple php binary that has all the modules I need compiled in. My general process is: ./configure --enable-static --enable-cli --disable-all This gives me a php binary with no extensions. From here I can add the extensions I need. For example to add curl and json

What does C(++) do with values that aren't stored in variables?

…衆ロ難τιáo~ 提交于 2019-12-04 17:33:49
问题 I'm a bit curious about how C and C++ handle data which isn't stored in variables, e.g: int IE6_Bugs = 12345; int Win_Bugs = 56789; Yeah - everything clear. IE6_Bugs has 123456 stored at it's specific memory address. Then what about.. if ( IE6_Bugs + Win_Bugs > 10000 ) { // ... So C grabs the values of the two variables and adds them in order to compare the result to the int on the right. But: Does IE6_Bugs+Win_Bugs ever reach RAM? Or does the processor directly compare the values via its own

To see all command line on output window while compiling

对着背影说爱祢 提交于 2019-12-04 17:18:57
问题 I want to see all commands while building/releasing on the output window. When I build my app I only see this: ------ Build started: Project: CemKutuphane, Configuration: Debug Any CPU ------ CemKutuphane -> D:\Projects\Test\CemKutuphane\CemKutuphane\bin\Debug\CemKutuphane.dll ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ========== There is no csc.exe args in these lines. But visual studio ide is running behind of this. Is there any way to see the all commands? 回答1:

.NET property generating “must declare a body because it is not marked abstract or extern” compilation error

霸气de小男生 提交于 2019-12-04 17:17:30
问题 I have a .NET 3.5 (target framework) web application. I have some code that looks like this: public string LogPath { get; private set; } public string ErrorMsg { get; private set; } It's giving me this compilation error for these lines: "must declare a body because it is not marked abstract or extern." Any ideas? My understanding was that this style of property was valid as of .NET 3.0. Thanks! The problem turned out to be in my .sln file itself. Although I was changing the target version in

slow JDK8 compilation

僤鯓⒐⒋嵵緔 提交于 2019-12-04 17:13:48
Trying to upgrade to JDK8 on a big project, compilation goes really slow on JDK8 compared to JDK7. Running the compiler in verbose mode, JDK8 compiler stops at a big generated converter class(Mapping) for entities from server to client. The converter methods in several cases call other converter methods from the same Mapping class. As a workaround tried to split the Mapping file into multiple files. This visibly improved performance when only compiling the Mapping class or it's containing project(projectA). But compile time was very slow for other projects which invoke converter methods from

Does undefined behavior really help modern compilers to optimize generated code?

大憨熊 提交于 2019-12-04 16:49:45
Aren't modern compilers smart enough to be able to generate a code that is fast and safe at the same time? Look at the code below: std::vector<int> a(100); for (int i = 0; i < 50; i++) { a.at(i) = i; } ... It's obvious that the out of range error will never happen here, and a smart compiler can generate the next code: std::vector<int> a(100); for (int i = 0; i < 50; i++) { a[i] = i; } // operator[] doesn't check for out of range ... Now let's check this code: std::vector<int> a(unknown_function()); for (int i = 0; i < 50; i++) { a.at(i) = i; } ... It can be changed to such equivalent: std:

Building Android source: error when executing mm?

 ̄綄美尐妖づ 提交于 2019-12-04 16:34:58
Update I got this working. How I am not sure. I did no config changes at all. What I did was: Modify Dialog in frameworks/base/core/java/android/app . Went to my root ( /path/to/source/ ). Then I did mmm frameworks/base/ . Everything worked. Then I tried exactly what I had already tried below: Modify ScrollView (I actually never said which file I was modifying) in frameworks/base/core/java/android/widget . I ch 'ed to frameworks/base/core/java/android/widget . Then I did mm . This time I had no errors like before when the files were removed. Now it just works. Maybe this was some caching or

How to check if a file exists in a makefile

不打扰是莪最后的温柔 提交于 2019-12-04 16:26:42
问题 I have a makefile template to compile a single DLL (for a plugin system). The makefile of the user looks like this: EXTRA_SRCS=file1 file2 include makefile.in In the makefile.in I have: plugin.dll: plugin.os $(patsubst %,%.os,$(EXTRA_SRCS)) Where plugin.os is the main C++ file to be compiled. Btw, the files ending is .os are the object files compiled for shared library (i.e. using the -fpic option with gcc ) Now, the problem is that the extra sources will probably (but not necessarily) be