shared-libraries

How from Ocaml can I call C++ code using itself a shared library .so ?

北战南征 提交于 2019-12-10 14:44:38
问题 I need to build an Ocaml/C++ module which calls a shared object (.so under linux) As long as it is a question to compile a simple Ocaml/C++ stub, I manage the thing but when I need to link the .so with ocamlmklib or ocamlopt, it fails I work under gcc 4.5 (c++0x) files for the shared object : hello.hpp #include <iostream> #include <string> using namespace std; class HelloApplication { public : HelloApplication(); ~HelloApplication(); void say(string s); }; typedef HelloApplication *(*create

Methods of managing source code

痞子三分冷 提交于 2019-12-10 14:19:05
问题 I've written a fair amount of software over recent years, most of which all tend to share one or more common libraries. (The most common library, being one that I use for calling SQL stored procedures and returning arrays of objects) I'm not happy with the way I manage the libraries, and I'm looking for suggestions to improve the way I work. The first time I created what is now a shared library, I added the library as a separate class library project within the solution. Now, when I start a

Why are only some of these C++ template instantiations exported in a shared library?

自闭症网瘾萝莉.ら 提交于 2019-12-10 13:57:50
问题 I have a C++ dynamic library (on macOS) that has a templated function with some explicit instantiations that are exported in the public API. Client code only sees the template declaration; they have no idea what goes on inside it and are relying on these instantiations to be available at link time. For some reason, only some of these explicit instantiations are made visible in the dynamic library. Here is a simple example: // libtest.cpp #define VISIBLE __attribute__((visibility("default")))

Boost in Netbeans 7.1.1

霸气de小男生 提交于 2019-12-10 13:49:25
问题 Trying to run the following: #include<iostream> #include<boost/filesystem/operations.hpp> namespace bfs=boost::filesystem; int main() { bfs::path p("second.cpp"); if(bfs::exists(p)) std::cout<<p.leaf()<<std::endl; } I got some errors in cygwin so I decided to try out netbeans, and used the following as a guide. I added all links and the following for filesystem Project -> properties -> Linker ->Libraries -> Add option -> Other -> -lfile_system as noted here. I have run a separate test using

Understanding color picker dialog

别等时光非礼了梦想. 提交于 2019-12-10 13:33:45
问题 I want to use this color pikcerdialog https://code.google.com/p/android-color-picker/ but i have no idea what to do. I've added external jars and stuff before but this is different when you download it you get a project. I'm not to new to android but am still relatively new. Is that whole project the library or something. I really don't know where to begin but would really like help. even a link to a tutorial would be nice because i dont know what to search. package com.example.color; import

-finstrument-functions doesn't work with dynamically loaded g++ shared objects (.so)

谁说胖子不能爱 提交于 2019-12-10 12:59:30
问题 I am testing -finstrument-functions with g++ shared object (.so) files on Ubuntu these days. I found a strange behavior that -finstrument-functions seems to work only if the library is statically linked. If I link to the library with dlopen/dlsym etc., the functionality of the code still works, but it won't call the __cyg_profile* functions. Here are some codes to quickly reproduce the problem: MyLib.h #ifndef __MYLIB_H__ #define __MYLIB_H__ class MyLib { public: void sayHello(); }; #endif

gcc: linked libraries in /usr/local/lib are not found, but /etc/ld/so.conf.d/libc.conf lists it?

。_饼干妹妹 提交于 2019-12-10 12:32:02
问题 I've got a problem with shared libraries and gcc. At first I couldn't run my compiled program because I was getting the following error: gcc error while loading shared libraries. I did some searching and found that this is because the shared library cannot be found. However I had already identified that the shared library is in /usr/local/lib, which AFAICT is a commonly used directory for shared libraries and should work from the get go. I read that you can set LD_LIBRARY_PATH, which worked

Sharing executable memory pages in Linux?

旧街凉风 提交于 2019-12-10 11:14:50
问题 Is it possible to share executable pages on Linux for the sake of preserving space? I know that there are shared memory APIs that can be used to share memory between different processes but I don't think that is meant to be used for that. Basically, I want to have a shared memory region where some commonly used shared libraries can be loaded into. I want to get the dynamic linker to link against the preloaded (read only) images instead of having to load all of the shared library images into

Linux, Mono, shared libs and unresolved symbols

你离开我真会死。 提交于 2019-12-10 10:58:13
问题 I have a shim library (shared, C++) which calls functions in another shared library (libexif) and presents a simple interface to C# for Platform Invoke calls. (That is, a C# program uses PInvoke to call my custom shared library which in turn calls another shared library.) In Windows, my custom shared library links to the shared library when my custom library links and when the C# application executes, all symbols are resolved. On Linux, linking my shared library does not link the other shared

C++ library across different compilers

巧了我就是萌 提交于 2019-12-10 10:50:53
问题 I'm writing a C++ library using MinGW (4.8.0 dw2 posix). This library is used in another C++ project that use another compiler( in this case msvc ). Refering to this I was redesign my C++ library. There are two things that I don't know how can I do: Can I use namespaces? I noticed that time_t on MinGW is 32 bit and in msvc is 64 bit. What Can I do? 1) Does this broke the ABI: // Window.h // MYLIB_API defined as __declspec( dllexports ) // MYLIB_CALL defined as __stdcall namespace mylib {