compilation

compile and run c++ code runtime

左心房为你撑大大i 提交于 2019-12-02 11:37:28
问题 Does anyone know how to compile your c++ code wich you write while your program is already running? And later i would like to run that code. I want to do this because I am trying to make a game that woul teach you programing and so the user would have to write the code while the game is running and test it. Thanks for any help 回答1: You'd have an easier time if you chose a language that was designed with embedding in mind - like LUA or python. For C++, you'd have to go for something extremely

Opencv functions can only be invoked in C code fashion but not in C++ fashion

限于喜欢 提交于 2019-12-02 11:24:23
I am really new to Opencv. After downloading and installing Opencv 2.4 according to the instruction, I began writing my first Opencv program, which was basically a copy of the tutorial on the web. #include <stdio.h> #include <iostream> #include <vector> #include "cv.h" #include "highgui.h" #include <stdio.h> #include <stdlib.h> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main( int argc, char** argv ) { char* filename = "C:\\Research\abc.pgm"; IplImage *img0; if( (img0 = cvLoadImage(filename,-1)) == 0 ) return 0; cvNamedWindow( "image", 0 ); cvShowImage( "image",

Compiling ImageMagick as 64bit under OS X?

試著忘記壹切 提交于 2019-12-02 11:09:11
I'm trying to install moddims on OS X (see previous question ), an Apache module with a dependency on ImageMagick. As far as I can tell, the OS X Apache is compiled as 64 bit. My previous attempt to run the moddims module I had compiled gave the following error: httpd: Syntax error on line 117 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libmod_dims.so into server: dlopen(/usr/libexec/apache2/libmod_dims.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/libmod_dims.so: mach-o, but wrong architecture I'm presuming that means I need to compile moddims as

How to run and compile java program?

自古美人都是妖i 提交于 2019-12-02 10:57:54
问题 I am compiling a simple program class Test { public static void main(String[] args) { System.out.println("Hello"); } } I typed in command prompt java Test.java But it did not work Could not find or load main class Test.java Im not using any IDE Where should i place the program file on my computer Thank you 回答1: You cannot directly run a java source file. You need to compile it first using javac : javac Test.java Then you get a .class file that you can run: java Test 来源: https://stackoverflow

compilation error on boolean expression

喜你入骨 提交于 2019-12-02 10:43:25
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 but in case of && both sides needs to be evaluated. That is not a homework, I am learning Java. Cheers

Compile with boost to use whatever boost version is available?

ぐ巨炮叔叔 提交于 2019-12-02 10:41:50
问题 I've compiled a Linux package on ubuntu 12.04 which uses boost and on this system i have boost 1.46. I tried to run the compiled release on another system and it complains that it can't find libboost_system.so.1.46.1. That system has boost 1.49 installed. How do I compile so that the program uses whatever version of boot exists instead of the specific version on the development machine. 回答1: You cannot expect your program to work with a different version of the library. The fact that there

compile driver on linux with make

一笑奈何 提交于 2019-12-02 09:53:08
问题 What does this error message mean? I am trying to run make. It looks like configure is missing. Configure is part of the kernel source? make -C /lib/modules/4.2.0-19-generic/build SUBDIRS=/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE modules make[1]: Entering directory '/usr/src/linux-headers-4.2.0-19-generic' CC [M] /home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o /home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179

What is wrong with my cross compiler?

谁说我不能喝 提交于 2019-12-02 09:32:47
I am trying to compile a basic program that i can get to cross compile on my mac. I am running Mac OS X Mavericks. My cross compiler is arm-elf-gcc-4.7.3. I wrote a simple test program that looks like: int main() { ; return 0; } When I run /opt/local/bin/arm-elf-gcc-4.7.3 -o test test.c I receive these errors. test.c:4:Unknown pseudo-op: .global test.c:4:Rest of line ignored. 1st junk character valued 109 (m). test.c:5:Unknown pseudo-op: .type test.c:5:Rest of line ignored. 1st junk character valued 109 (m). test.c:7:Junk character 64 (@). test.c:7:Rest of line ignored. 1st junk character

Compiling Java file with code from within a Java file

こ雲淡風輕ζ 提交于 2019-12-02 09:12:24
I'm currently creating a personal (maybe public) java terminal. I want to create a command that will create + compile a Java file on execution, except I'm not too sure on how to actually do this. Is it possible? Or am I just dreaming? You could also use Groovy - it's quite handy if you just want to compile and run a line or two of Java code from within your application. The application may be in regular Java, with Groovy used only for compilation of the dynamically generated code. Whichever solution you choose, be careful, as executing user input as code can lead to security issues

Compiling errors at API level 28

别来无恙 提交于 2019-12-02 09:07:43
问题 I'm trying to compile an .apk from source code at API level 28 (compileSdkVersion 28). The app compiles fine but after installation it crashes. My app has Admob Ads in the UI itself on various pages. Here's my project-level build.gradle - buildscript { repositories { jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' classpath 'com.google.gms:google-services:4.2.0' } } allprojects { repositories { jcenter() google() } } Here's my app-level build.gradle -