compilation

C++ compiles but gives error when executed

偶尔善良 提交于 2019-12-22 08:28:25
问题 I am new to Linux Ubuntu 11.10 and have basic C++exposure. I installed the g++ by sudo apt-get install build-essential and created a directory cpp in my home directory. I then wrote a program hello.cpp in my cpp directory #include <iostream> using namespace std; int main() { cout << "Hello !" ; return 0; } and compiled using g++ -W hello.cpp -o hello The program compiles without any errors/warnings. When I try to execute the file ./hello.cpp I get error messages: line 3: using: command not

How to ignore .java files when compiling using maven?

偶尔善良 提交于 2019-12-22 08:13:35
问题 I have .java files in my source directory that don't compile yet due to some API change. I would like to fix sources one by one and it would be useful to ignore some of them to run tests. 回答1: With the maven compiler plugin and the exclude option: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <excludes> <exclude>**/*Point*.java</exclude> </excludes> </configuration> </plugin> </plugins> </build> Resources:

c compiler cannot create executable on mac

柔情痞子 提交于 2019-12-22 08:10:12
问题 Everytime I try to install a package or software on my mac (Maverick) from a config file, it automatically fails when checking the C compiler. It says "configure: error: C compiler cannot create executables". Besides, Homebrew works perfectly. I attached an example of config.log. I haven't found any satisfaction in the related previous posts, I apologize if the issue was solved. ## ----------- ## ## Core tests. ## ## ----------- ## configure:2530: checking for gcc configure:2546: found /usr

Trying compile a C Code with PHP

倾然丶 夕夏残阳落幕 提交于 2019-12-22 08:03:52
问题 I have a file named gcc.exe and I have a php page... I want to use: gcc test.c And, if there's some compilation error, I want to show it on the php page... But I can't. What happens is: If the file is correct, it generates the .exe file, but if it's wrong, nothing happens. What I want here, again, is to show all errors. Anyone has an idea? Edit[1]: Some code: <?php exec("gcc teste.c",$results); print_r($results) ?> Output: *Nothing* Edit[2]: I tryed put gcc output on a text file: This way (on

How can I generate an ELF file with GCC?

会有一股神秘感。 提交于 2019-12-22 06:56:47
问题 I am writing C and C++ code on Linux OS and I am using GCC. After finishing my code, I would like to generate an ELF file. I just can generate "a.out" file and I don't need it. How can I get ELF file ? ELF file occurs as a result of what ? or Is it possible to generate this file with this program ? 回答1: The compiler (i.e. gcc or g++ ) will invoke the linker ( ld ) which produces an ELF executable. In practice, you will use a builder program (like make ) to drive gcc commands. See this answer.

Scala Play 2.3 InteliJ 14 *community edition - is it possible to run project without cmd line activator command

孤人 提交于 2019-12-22 06:47:52
问题 From http://blog.jetbrains.com/scala/2012/12/28/a-new-way-to-compile/ I understand that Intellij is using sbt to build - so thats 1x build At the moment I run a separate command line task to run my project - ./activator -jvm-debug 5000 -Dhttp.port=9000 So each code change gets compiled twice (once by InteliJ; once by activator) Is there a way to use the InteliJ build artifacts when I run, so the code is only compiled once? Is using the Terminal window in InteliJ any different from a normal

"don't know what to do with' nvcc fatal error

左心房为你撑大大i 提交于 2019-12-22 06:47:10
问题 I use the command lines in Ubuntu's terminal. And I am trying to compile the three files presented in CUDA_Compiler_Driver_NVCC.pdf When I do use the command line given by the documentation on these 3 files, I do get the following errors: nvcc fatal : don't know what to do with'-dc' If I erase -dc in the command line, I do get the following error too: nvcc fatal : don't know what to do with'-arch=sm=20' Do anyone know how I could fix this issue ? Thanks a lot in advance for your help Gibo

The service did not respond to the start or control request in a timely fashion if Debug dll used

♀尐吖头ヾ 提交于 2019-12-22 06:37:03
问题 I was trying to deploy a windows service on my machine, but when I was trying to start it I got following error. "Windows could not start the 'myService' on Local Computer. Error 1053: The service did not respond to the start or control request in a timely fashion." After a bit of research I found out that I was complining my project with Debug option, the moment I changed it to 'Release' mode all was good and working. I can not make sense of this behaviour so I searched the net and found

Result type in structural refinement may not refer to a user-defined value class

徘徊边缘 提交于 2019-12-22 05:54:22
问题 When I define Wrapper as value class(extending AnyVal): class Wrapper(val string: String) extends AnyVal def wrapperHolder(w: Wrapper): {def wrapper: Wrapper} = new { def wrapper: Wrapper = w } I have following compile error for wrapperHolder: Error:(5, 22) Result type in structural refinement may not refer to a user-defined value class def wrapper: Wrapper = w Why it doesn't work for value class? 来源: https://stackoverflow.com/questions/52678323/result-type-in-structural-refinement-may-not

Can ruby scripts be precompiled into a binary?

那年仲夏 提交于 2019-12-22 05:38:05
问题 I'm working on a Ruby script that will need to be deployed onto systems without a ruby interpreter. It will need to run on FreeBSD systems which uses the ELF format. I know there is a ruby2exe project to compile ruby scripts to run on Windows, but is it easy or even possible to do that on other operating systems? 回答1: Have you checked whether Rubinius or JRuby would allow you to precompile your code? 回答2: Aside from bytecode that requires a VM to run, Ruby cannot be compiled. It is an