shared-libraries

Calling UNIX and Linux shared object file .so from c#

对着背影说爱祢 提交于 2019-12-01 03:57:27
Is there a way for a Shared Object file written in C and built on Unix to be called from C# P/Invoke? Or do I need to use Java or something like that? Mono has the ability to integrate with native libraries from within C# built on top of dlopen(3). You just have to use the DllImport statement with the name of the library (i.e. 'libform.so.5'), then wrap the native code and data types with a friendly C# class that takes care of all the low-level stuff. This page has a good overview with lots of information on how to deal with marshaling pointers and other unsafe types. Once you've got your

Hiding symbols in a shared library on Mac OS X

余生颓废 提交于 2019-12-01 03:34:22
We've been building a large open source software on a variety of platforms (Linux, Windows, Mac OS X, 32-bit and 64-bit) for several years without troubles. Lately however, the Mac OS X build (64-bit) stopped working correctly and started to crash randomly. It more or less coincided with an update of Mac OS X on our build machine from 10.7 to 10.8.2 (but the compiler toolchain didn't change, it's still llvm-gcc 4.2.1). Our application is made of a couple of dynamic (shared) libraries and many executables using them. One of the shared library overrides the new and delete operators for a variety

version-script and hidden visibility

点点圈 提交于 2019-12-01 03:30:43
When using gcc to build a shared library, it's possible to limit the visibility of the symbols using -fvisibility=hidden . I also just learned you can limit visibility using the version-script option to ld . Now I want to know if it's possible to combine these. Say I have a program with the following: void foobar() {} void say_hello() {} Then I have the version script file with: { global: foobar; } And I compile this with: gcc -fvisibility=hidden -Wl,--version-script=<version-script> test.c -shared -o libtest.so When I run nm on this afterwards, I find that no symbols are exported. Is there

How to install the Six module in Python2.7

时光怂恿深爱的人放手 提交于 2019-12-01 03:17:32
I am using Python 2.7 and trying to use dateutil as follows: from dateutil import parser as _date_parser However, I get the following error: Traceback (most recent call last): File "<pyshell#17>", line 1, in <module> from dateutil import parser as _date_parser File "C:\Python27\Lib\dateutil\parser.py", line 24, in <module> from six import text_type, binary_type, integer_types ImportError: No module named six Could you please let me know what is the six module for and how to get it installed in a Windows 7 machine? You need to install this https://pypi.python.org/pypi/six If you still don't

/usr/bin/ld: client: hidden symbol `__dso_handle'

余生颓废 提交于 2019-12-01 03:04:20
问题 I am trying to link with a shared lib in my C++ program. command I used: g++ -o client Client.cpp -L. -lprint Following is the error: /usr/bin/ld: client: hidden symbol `__dso_handle' in /usr/lib/gcc/i486-linux-gnu/4.4.3/crtbegin.o is referenced by DSO /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: ld returned 1 exit status How can I resolve this error? 回答1: hidden symbol `__dso_handle' in /usr/lib/gcc/i486-linux-gnu/4.4.3/crtbegin.o is referenced by DSO

how can i use a shared lib in glassfish to avoid deployment of the huge libs?

隐身守侯 提交于 2019-12-01 02:18:06
问题 I have to upload about 30M for my app since it uses a lot of libraries, log, web engine and so on. I think there should be a way to share these libs on glassfish, but I failed to figure it out. I tried to put them in domain/lib/ext but does not work. So where should I store these libs and how should I refer to them? thank you. 回答1: Why domaindir/lib/ext does not work? from glassfish manual: Optional packages are packages of Java classes and associated native code that application developers

Creating both static and shared C++ libraries

℡╲_俬逩灬. 提交于 2019-12-01 01:51:57
问题 I'd like to build both static and shared libraries in a project. I know that shared libraries need to be be created from objects compiled with -fpic to get Position Independent Code while the static library doesn't need this. This is all fine and I can create either a shared or static library. I wouldn't want to compile my source twice to get the different object files, so how is this usually done? I read how to get a shared library based on a static one. However, the example shows the static

Distributing Windows C++ library: how to decide whether to create static or dynamic library?

心不动则不痛 提交于 2019-12-01 01:07:24
We have been converting our Java and .NET API library to C++, and are trying to figure out what is the best way to distribute a compiled version to other developers to use with their custom applications. Should it be a static library or dynamic library? We need to create for both Win32 and Win64 (and I suppose both a Debug and Release version of each target OS). Given all the frustration I've encountered trying to make sure all referenced libraries are matched (/MT versus /MD), I'm wondering if there is a decision to make here which will simplify it for other developers. When I run dumpbin

What are the default search directories to link a library on Mac OS X

血红的双手。 提交于 2019-12-01 00:59:48
问题 I've build the Google Test with CMake on Mac OS X and get two shared libraries: libgtest.dylib and libgtest_main.dylib . And now I need install both them. I know there are some default search directories on Linux, such as /usr/lib , /usr/local/lib , etc.. But I am unfamiliar with Mac OS X and don't know where to place those libraries. In Mac OS X Directory Structure, I find there are three directories of libraries: ~/Library , /Library and /usr/lib . And I've tried to place gtest libraries

Calling UNIX and Linux shared object file .so from c#

核能气质少年 提交于 2019-12-01 00:45:21
问题 Is there a way for a Shared Object file written in C and built on Unix to be called from C# P/Invoke? Or do I need to use Java or something like that? 回答1: Mono has the ability to integrate with native libraries from within C# built on top of dlopen(3). You just have to use the DllImport statement with the name of the library (i.e. 'libform.so.5'), then wrap the native code and data types with a friendly C# class that takes care of all the low-level stuff. This page has a good overview with