shared

C++: How to create two interdependent shared libraries?

喜你入骨 提交于 2019-12-11 11:12:10
问题 Suppose I want to compile a.cpp and b.cpp into two separate shared libraries liba.so and libb.so and the two libraries are interdependent, how can I go about doing it? 回答1: Although I can think of several hack-ish way to implement something like that, they all have their own disadvantages, and the whole issue is moot for the following reason. Although you did not explicitly mention which platform you use -- and details of shared library implementation is highly platform specific, so that, in

c# use datatable in other form datagridview

怎甘沉沦 提交于 2019-12-11 10:38:20
问题 Hi Ive searched many topics, also here in stackoverflow, however none solved my problem This is my main form where I operate with my database and display items in datagridview public partial class Form1 : Form { DatabaseConnection objConnect; string conString; private static DataTable table; DataSet dataSet; public Form1() { InitializeComponent(); CreateConnection(); MakeDataTable(); } public DataTable table { get { return table; } } private void MakeDataTable() { table = new DataTable();

Lookup failure when linking using -rpath and $ORIGIN

旧巷老猫 提交于 2019-12-11 09:17:52
问题 I'm trying to learn how to use the -rpath option in GCC's linker (ld) with $ORIGIN . I'm trying the simplest example I can think of (see below), and all the links I read seem to say I'm doing it correctly. However, when I run the executable it can't find the shared object unless I run it from within $ORIGIN . Using readelf -d on the executable (main.run) shows: 0x0000000000000001 (NEEDED) Shared library: [lib/foo.so] ... 0x000000000000000f (RPATH) Library rpath: [$ORIGIN] ... The file

Sharing Java library with Android Apps

一个人想着一个人 提交于 2019-12-11 08:26:02
问题 I'm just getting started in Android development, and use Netbeans with NBAndroid and SDK 17. I'd like to use the same Java source code in my Java and Android app. http://developer.android.com/guide/developing/projects/projects-eclipse.html says how to do it in Eclipse (although it is sketchy on the .JAR connection thing), but I can't seem to make it work in NB. Based on that link, My understanding is that the correct setup for the Android app is an Android Application project which references

C++ Ref Count Changes While Destructing Object

丶灬走出姿态 提交于 2019-12-11 05:22:47
问题 I've got a private ref count inside the class SharedObject. SharedObject is a base class for other classes, for example Window. Window is the base class of Editor. When the ref count reaches 0, because of calling SharedObject::Release(), the SharedObject deletes itself. First we get to the Editor destructor, which shows that the this pointer contains m_refs == 0, but when we get to the Window destructor it is suddenly 1, and when we reach the SharedObject destructor, it is still 1. I put a

delphi XE7 firemonkey android shared object / library to be dynamically loaded - template

蹲街弑〆低调 提交于 2019-12-11 04:35:06
问题 Is there a template to create a .so file that can be loaded by another delphi ape file - I have tried starting a blank fire monkey project and changing program to library and build it but the .so file that it produces won't load with dlopen within another delphi project. I have read that in other development environments there is a islibrary setting. I guess more to the point is there an example .so library built with fire monkey - I have found the bare bones link without fire monkey but it

Cuda reuse of shared memory variable name

北城余情 提交于 2019-12-11 02:18:47
问题 I have two cuda kernels that are run, one after the other: __global__ void calculate_histo(const float* const d_logLuminance, unsigned int* d_histogram, float min_logLum, float lumRange, int numBins, int num_elements){ extern __shared__ float sdata[]; int tid = threadIdx.x; int bid = blockIdx.x; int gid = tid * blockDim.x + bid; // load input into __shared__ memory if(gid < num_elements) { sdata[tid] = d_logLuminance[gid]; __syncthreads(); //compute bin value of input int bin = static_cast

Using the Swift Singleton

余生颓废 提交于 2019-12-11 01:58:54
问题 I've got the following Singleton class: class Singleton { static let sharedInstance = Singleton() } I can find very little online about how to use the numerous swift implementations of the Singleton pattern. I have used it before in Objective-C on a previous application but to me it seemed much more straight forward. For instance, if I wanted to create an array of custom objects that could be used anywhere in the application, how would I declare it, and how would I implement it. In my

GCC Shared Library Problems

女生的网名这么多〃 提交于 2019-12-10 22:57:12
问题 I'm trying to create a shared library on ubuntu using gcc I just have one simple class(shared.h and shared.cpp) and one client to use it (main.cpp) This is my makefile and I'm still not able to to get the program to compile. all: #compile object(fPIC: creates position independent code) gcc -fPIC -Wall -g -c shared.cpp #compile shared library gcc -shared -Wl,-soname,libshared.so.1 -o libshared.so.1.0.1 shared.o -lc #link shared library gcc -g -o main main.cpp -L. -lshared I'm confident the

Share database between app and web

烈酒焚心 提交于 2019-12-10 18:04:43
问题 I'm involved into an app that have to retrieve queries from an existing database. This db have to be implemented in php in a remote server, and will be the place where the admin will have to insert content into the shared db, but I don't know how to implement that correctly or what is the best solution. I'm thinking about make a sqlite database with php and connect directly the app to the db, but I haven't found yet the best way to do that. What do you think? Thank guys. 回答1: FYI, without any