compilation

How to compile an extension into sqlite?

佐手、 提交于 2019-12-10 10:57:53
问题 I would like to compile an extension into sqlite for loading at runtime. The file I am using is extension - functions.c from https://www.sqlite.org/contrib I have been able to compile into a loadable module but I need to statically link it for loading at runtime (using shell.c to create an interface at run time) I have read the manual on linking, but to be honest, it's a little bit beyond my scope of comprehension! Could someone let me know what I need to do to compile please? 回答1: I'm not

How will I include a Java jar file when compiling a Java class and running the Java file from the command console?

痴心易碎 提交于 2019-12-10 10:46:17
问题 I have a small Java file interacting with a postgresql database, so I've downloaded the drivers and in my file I import org.postgresql.Driver . In the command console I type javac Myfilename.java ; then it compiles I run java Myfilename and it throws an error saying it can not find the org.postgresql.Driver files. So how do I import the jar when I run the file or when I compile the file not sure when the import should take place? 回答1: Compile: javac -cp ".:postresql.jar" -d . MyFileName.java

How can I automaticly compile only projects that have changed when I build my solution in VS2010?

£可爱£侵袭症+ 提交于 2019-12-10 10:33:29
问题 I am doing TDD development on a large solution in my company, we use visual studio 2010, I have the problem of long compile time, because it compiles the whole solution each time I do a small change in only one file, It compile very often so slows me down. Is there a way to tell VS2010 to compile only the project that has changed or some other solution to my problem, we have 20 projects inside the solution, I often touch 2-3 of them when I code. Thanks. 回答1: Check out NCrunch. NCrunch

stoi and stoll in c++

别等时光非礼了梦想. 提交于 2019-12-10 09:37:41
问题 I have #include(string) in my declaratives at the top of the program but when I try to run stoi(string) or stoll(string) i get the following error. I am running Cygwin g++ v4.5.3. Z:\G\CSCE 437>g++ convert.cpp -o conv convert.cpp: In function void transfer(std::string*)': convert.cpp:103:36: error: stoll' was not declared in this scope convert.cpp:116:35: error: `stoi' was not declared in this scope fileTime[numRec] = stoll(result[0]); //converts string to Long Long if(numRec = 0){

Checking file size in makefile, stopping if file is too short

六眼飞鱼酱① 提交于 2019-12-10 09:36:14
问题 Is there a way to check if the size of a particular file is less than some constant? I'm assuming things about size in the makefile and want to make sure I'll get an error if my assumptions are not met. Something like assert, but in makefile. if filesize(file) > C then error else continue compilation 回答1: Put this in your rule, somewhere before the compilation: test -n "$$(find filename -a -size +NNNc)" where filename is the filename and NNN is the size in octets. This returns false and halts

Error while running parallel make

余生长醉 提交于 2019-12-10 09:29:39
问题 Consider following make: all: a b a: echo a exit 1 b: echo b start sleep 1 echo b end While running it as make -j2 I receive the following output: echo a echo b start a exit 1 b start sleep 1 make: *** [a] Error 1 make: *** Waiting for unfinished jobs.... echo b end b end We have quite a big make file and it's easy to miss error, since there's no error message at the end of execution. Is there a way for error message to appear also just in the end of the make execution? UPDATE: See my

howto call c# (mono , .net) methods, delegates from native c

若如初见. 提交于 2019-12-10 09:28:12
问题 is it possible to call c# methods written in managed code (maybe in a class or a library) from a native c code (and how)? thx edit: with "c#" i mostly refer to mono or even portable.net and the OS is Linux 回答1: Your C code can define functions to register callbacks. The C# code can P/Invoke these functions, and pass managed delegates as arguments. The marshalling code will transparently transform these to C function pointers. Alternatively, approaching it from the C side, you can use the Mono

what is the right abstraction for compilation unit in LLVM?

橙三吉。 提交于 2019-12-10 06:54:44
问题 in LLVM we have the LLVMContext , which is the unit of storage, and we have the llvm::Module , which is where new symbols (functions and types) are built. my question is; what is the right llvm abstraction to use for compilation units? is the Module ? or is this actually meant for a bigger scope, i.e: a shared library target It seems to me that a compilation unit must satisfy an all-or-nothing result; either it compiles all its content without errors, or either there are errors and it needs

OpenCL online compilation: get assembly from cl::program or cl::kernel

点点圈 提交于 2019-12-10 05:18:36
问题 I'm running kernel benchmarks with OpenCL. I know that I can compile kernels offline with various tools from OpenCL vendors (i.e. ioc64 or poclcc ). The problem is that I get performance results that I cannot explain with the assembly from these tools, the OpenCL runtime overhead or similar. I would like to see the assembly of online compiled kernels that are compiled and executed by my benchmark program. Any ways to do that? My approach is to get this assembly somewhere from the cl::program

Writing unit tests in my compiler (which generates IL)

China☆狼群 提交于 2019-12-10 02:38:51
问题 I'm writing a Tiger compiler in C# and I'm going to translate the Tiger code into IL . While implementing the semantic check of every node in my AST, I created lots of unit tests for this. That is pretty simple, because my CheckSemantic method looks like this: public override void CheckSemantics(Scope scope, IList<Error> errors) { ... } so, if I want to write some unit test for the semantic check of some node, all I have to do is build an AST, and call that method. Then I can do something