compilation

Java overloaded method in library fails when not run in web server

橙三吉。 提交于 2020-01-02 09:41:53
问题 I am trying to write a small library that can either be used in a standard java app or as part of a servlet. I have defined a couple of overloaded methods as follows: // imports etc. public ExampleLibrary { /** * This one is meant to be used by a J2SE app */ public String processData(Map headers) throws MyException { // process // return result } /** * This one is meant to be used by a servlet */ public String processData(HttpServletRequest request) throws MyException { // extract headers

Java overloaded method in library fails when not run in web server

霸气de小男生 提交于 2020-01-02 09:41:37
问题 I am trying to write a small library that can either be used in a standard java app or as part of a servlet. I have defined a couple of overloaded methods as follows: // imports etc. public ExampleLibrary { /** * This one is meant to be used by a J2SE app */ public String processData(Map headers) throws MyException { // process // return result } /** * This one is meant to be used by a servlet */ public String processData(HttpServletRequest request) throws MyException { // extract headers

converting PDF to JPEG on AWS Lambda

Deadly 提交于 2020-01-02 09:37:10
问题 I've written a small lambda Python function that makes use of pdf2image to convert a PDF file's pages into separate JPG files. This library is a wrapper around poppler-utils , in particular pdftoppm . Works fine on my Ubuntu system, but of course AWS Lambda is different. So I went to look for a version of poppler that I could compile on an EC2 instance for AWS Lambda and found the slightly dated Poppler-build ansible playbook. With some tweaks, I got it to work, however the Poppler version

What is an efficient workflow with C? - Makefile + bash script

大憨熊 提交于 2020-01-02 07:54:08
问题 I'm working on one of my first projects that will span more than one C file. For my first couple practice programs, I just wrote my code in main.c and compiled using gcc main.c -o main . This worked for me as I was learning. Now, I'm working on a much bigger project on my own. I want to continue doing compilation on my own (or at least setting it up manually) so I can understand the process. After reading a bit, I decided to make a Makefile. Note: I'm also using GTK+, so I had to look up how

Build OpenCV with OpenCL support

偶尔善良 提交于 2020-01-02 06:18:10
问题 in CMake, I built OpenCV with OpenCL Enable ON(It automatically detected the OPENCL_INCLUDE_DIR path but the OPENCL_LIBRARY was empty, even after clicking config. for OPENCL_LIBRARY i don't see browse button either .. after generating opencv binaries then i run the below code #include <iostream> #include <fstream> #include <string> #include <iterator> #include <opencv2/opencv.hpp> #include <opencv2/core/ocl.hpp> int main() { if (!cv::ocl::haveOpenCL()) cout << "OpenCL is not avaiable..." <<

C/C++ Indeterminate Values: Compiler optimization gives different output (example)

心已入冬 提交于 2020-01-02 05:50:11
问题 It seems like the C/C++ compiler (clang, gcc, etc) produces different output related to the optimization level. You may as well check the online link included in this post. http://cpp.sh/5vrmv (change output from none to -O3 to see the differences). Based on the following piece of code, could someone explain a few questions I have: #include <stdio.h> #include <stdlib.h> int main(void) { int *p = (int *)malloc(sizeof(int)); free(p); int *q = (int *)malloc(sizeof(int)); if (p == q) { *p = 10;

Cannot compile mergevec.cpp from Haartraining tutorial

喜夏-厌秋 提交于 2020-01-02 04:40:27
问题 I have been following this tutorial ( http://note.sonots.com/SciSoftware/haartraining.html ) to do some Haar training. I am currently stuck on creating the training samples, specifically the combining of the .vec files. I am provided with this ( http://note.sonots.com/SciSoftware/haartraining/mergevec.cpp.html ) file and a description of how to build it for Linux (Ubuntu 11.04). Here lies my problem, I am unable to build the mergevec code. The only error is "fatal error: cvhaartraining.h: No

Android Studio The project is already registered

天大地大妈咪最大 提交于 2020-01-02 04:07:06
问题 I've a big problem with Android Studio. I have a project that depends on two other projects (as libs). I followed the guide Problems importing project into Android Studio regarding ActionBarSherlock for import external modules. I opened "Project Structure", imported the module, but after that I can't see it in the Modules area. The Modules area contains only the root module, seems it is not refreshed (this is strange). So if I try to add the module as a Dependency, Android Studio doesn't find

How the code run when exist override ambigous function?

…衆ロ難τιáo~ 提交于 2020-01-02 04:06:28
问题 I can not fully understand the code result when exist override ambigous function. I have a libray libMy , which contains two class A and B . The code shows as follows // A.h #ifndef included_A_h #define included_A_h class A { public: void print(); }; #endif // A.cpp #include "A.h" #include <iostream> void A::print() { std::cout << "A from library" << std::endl; } // B.h #ifndef included_B_h #define included_B_h class A; class B { public: void printA(A &a); }; #endif // B.cpp #include "B.h"

How can I add a flag at the end of the linking command line using CMake?

邮差的信 提交于 2020-01-02 03:47:08
问题 I've got an issue where CMake can't detect pthread. As a work-around I tried: set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread") However, this inserts -lpthread in the wrong place: /usr/bin/c++ -std=c++11 -D_GNU_SOURCE -Wall [manyflags ...] -lpthread \ CMakeFiles/connectivity_tool.dir/connectivity_tool/conn_tool.cpp.o \ -o connectivity_tool -rdynamic -lboost_system [many libraries...] This results in: /usr/bin/ld: /tmp/ccNvRifh.ltrans3.ltrans.o: undefined reference to symbol