0

I am able to build and run AutobahnCpp on Eclipse CDT Luna using Cygwin GCC. Though, I need to make this app available to the 3rd parties through an API. Having created an API, I tried generating static (.lib) and shared (.dll) libraries so that 3rd parties can use them by calling the API methods. The problem is that the 3rd parties are on Visual Studio and the libraries (.lib and .dll) Eclipse CDT generates are no good for Visual Studio 2012. As far as I can tell, creating .dll and .lib libraries are no brainer on Eclipse CDT. However, Visual Studio is not liking them. I confirm that the libraries' contents are no good by dumping them using MS Visual Studio's dumpbin utility. The .dll looks relatively OK except that the single method name is appended by weird characters such that method: getMetar dumps as "_ZN11AutobahnCpp8getMetarESsSsSsSsSsSsSsSs". The .lib looks out of control with plenty of exceptions referring to the boost libraries such that

"$_ZGVN5boost16exception_detail37exception_ptr_static_exception_objectINS0_10bad_alloc_EE1eE 8 .data$_ZGVN5boost16exception_detail37exception_ptr_static_exception_objectINS0_14bad_exception_EE1eE "

Any help is appreciated. Am I misusing the Eclipse CDT while creating the libraries? Or this is a common problem that Eclipse CDT's output is no good by MS Visual Studio?

  • AutobahnCpp is a header-only library. That means, it is supposed to be distributed in source. When you build and executable or library, the compiler will only instantiate C++ templated classes for instances actually used. – oberstet Feb 16 '15 at 19:26
  • I am sorry but it is not clear to me. What you are saying is that creating an API is not an option and that source files should be distributed. Is that right? What if I want to hide the implementation from the 3rd parties and that although I use AutobahnCpp in my code, I have other source that adds additional capabilities. Can't I distribute that by creating static and dynamic libraries? – James Derrick Feb 17 '15 at 22:36
  • What I meant is the following (I am not completely positive about whether that is your actual problem). Say you expose `template void myfun(T t)` in your library API. Then you must distribute a definition of `T` in source. Otherwise: how would the compiler run by the user know how to create a `T` and call `myfun`? – oberstet Feb 17 '15 at 22:45

0 Answers0