shared

Can shared library call another shared library?

别等时光非礼了梦想. 提交于 2019-11-28 09:23:30
Can one shared library load and call functions from another shared library? I have Shared library libDsmTestLib.so that use another shared libraries libDsmShared.so and libPINDsmShared.so LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := DsmTestLib LOCAL_SRC_FILES := DSM_Library.cpp LOCAL_LDLIBS := -lDsmShared LOCAL_LDLIBS += -lPINDsmShared include $(BUILD_SHARED_LIBRARY) when I create libDsmTestLib.so and want to use it in my android java application like this: package com.dsm; import android.app.Activity; import android.os.Bundle; public class dsmTest extends Activity { /**

ld: Using -rpath,$ORIGIN inside a shared library (recursive)

谁说胖子不能爱 提交于 2019-11-28 04:57:10
I just made a basic example of using ld's -rpath option with $ORIGIN here (see 2nd response for a working version). I'm trying to create an example where main.run links to foo.so , which in turn links to bar.so , all using rpath and $ORIGIN . The run-time file-structure is: project/ lib/ dir/ sub/ bar.so foo.so run/ main.run (failing to build) I'm building foo.so using: g++ -c -o obj/foo.o src/foo.cpp -fPIC g++ -shared -o lib/dir/foo.so obj/foo.o -Wl,-soname,foo.so -Wl,-rpath,'$ORIGIN/sub' -Llib/dir/sub -l:bar.so Which builds fine. ldd lib/dir/foo.so can even find bar.so . However, when I try

Sharing authentication between two web applications

你说的曾经没有我的故事 提交于 2019-11-28 04:41:28
I have a base web site ( Asp.net WebForms application) running under ie. http://localhost:90/ Then I created a new (this time Asp.net MVC ) application and added it under http://localhost:90/mvc/ but not just as a simple virtual folder, but as an application folder by defining a different application pool to run it, compared to the parent application. Since browsers can't know that there are two different application basically on the same domain it would work like: user accesses http://localhost:90/ parent app redirects the user to forms authentication screen user successfully logs in parent

Using both .so and .dll on Windows

左心房为你撑大大i 提交于 2019-11-28 01:40:37
问题 I am writing a program in windows in C++ in which users will be able to compile extensions in the form of dynamic-link libraries (windows), or shared object files (linux). On windows, you use the LoadLibrary function to load a dll. Is it possible to do the same for .so files on windows and vice versa, load .dlls on linux? 回答1: The short answer is "No" That is not about loading but about internal format of dynamic library like expected entry points. Each operating system support it's own

Sharing a variable between multiple different threads

梦想与她 提交于 2019-11-27 21:20:55
I want to share a variable between multiple threads like this: boolean flag = true; T1 main = new T1(); T2 help = new T2(); main.start(); help.start(); I'd like to share flag between main and help thread where these are two different Java classes I've created. Is any way to do this? Thanks! Brian Agnew Both T1 and T2 can refer to a class containing this variable. You can then make this variable volatile , and this means that Changes to that variable are immediately visible in both threads. See this article for more info. Volatile variables share the visibility features of synchronized but none

cygwin g++ Linker doesn't find shared library

﹥>﹥吖頭↗ 提交于 2019-11-27 18:18:27
问题 I have been creating a library. When I compile it as a static library, it works fine. Now I want to turn it into a shared library. The library is created and in the proper place, but when I try to compile the client code, the linking phase says that it can't find the library. I already tried to rename it to al or dylib but that doesn't help either. When I put the -v flag on the linking, I can see that my library path is there. I also tried different paths. I used a relative path, but even

C - shared memory - dynamic array inside shared struct

好久不见. 提交于 2019-11-27 17:45:33
问题 i'm trying to share a struct like this example: typedef struct { int* a; int b; int c; } ex; between processes, the problem is that when I initialize 'a' with a malloc, it becomes private to the heap of the process that do this(or at least i think this is what happens). Is there any way to create a shared memory (with shmget, shmat) with this struct that works? EDIT: I'm working on Linux. EDIT: I have a process that initialize the buffer like this: key_t key = ftok("gr", 'p'); int mid =

User preferences file vs App preferences file

对着背影说爱祢 提交于 2019-11-27 16:27:51
问题 My android application has two kinds of preferences: 1) I have user preferences defined in res/xml/preferences.xml so that users can manage their preferences with a PreferenceActivity. 2) I'd like to define another file for global configuration preferences of my app. What is the best way to manage my app config preferences? Should I create another XML file with config values or should I specify those config values in strings.xml? What is the best practice for managing config preferences? 回答1:

面向期望(Oriented expectations)

戏子无情 提交于 2019-11-27 11:25:59
走过或者正在走在OOP思想中,我们一直坚信的JAVA实现. 面向期望, 我们不再想什么做什么;想如何做好就如何做;想给客户解释为什么这样做,而不是按照客户想要的去做;不再把技术的难度欺压在用户的期望上;而是: 用户所期望的就是我们想要的; 用户如何使用好使我们就如何去做; 只做他所需,不做己所求. 站在用户的角度,实际地去想你就是一个普通的用户,我就是这应用中的一个角色,当我打开页面时,我期望的页面是什么样的,有哪些内容是我所关心的,我如何操作最方便,最能达到我所想要完成的事情或操作;不再是我想它应该是这样的, 而应该是: 我就是用户, 我就期望它是这样的,不是那样的. 让操作舒服,让用户喜欢,让流程清晰,让目的明确,让他们所认可, 这就是目的. 我们站在技术角度的思想,完全不是一个用户所想的,转变角色,我们这里不谈实现,不谈if-else,不谈代码风格. 要做的,只是闭上双眼,想像你就是用户,打开浏览器(或其他UI界面),想我想的页面应该是什么样的,我所期望的注册是什么样的,信息浏览是什么样的,要登录是什么样的,当需要帮助时是如何提示的; 甚至就去听听那些完全不懂技术的朋友,用户或者一个街边陌生人所想要的(面对从任意1000人中抓出来也不足一两个懂技术的人群,那998或999人的意见是更重要的,也更值得聆听的). ... @see http://blog.csdn.net

How to create a Shared Login Service across Multiple Domains?

旧时模样 提交于 2019-11-27 09:17:40
问题 I'm interested in how to implement a shared cross-domain login system as well as best practices and security precautions to take. If you are familiar with 37Signals, you are probably accustomed to their usage of having a shared universal authentication mechanism whereby you do not have to subsequently login if you use the top level navigation to a different product. I would like to implement something in a similar fashion. The closest thing I've found online is the Wikipedia entry on a