From: Smith J. (E. - U. - U. Group)
<jac...@un...> - 2009-06-10 10:25:23
|
I am a new SWIG user. I have inherited a project which relies upon SWIG for wrapping several C++ libraries for use by C# and Java clients (two seperate SWIG configs) The C++ libraries make extensive use of ACE, and expose interface classes (a C++ class with only pure virtual functions) in which some ACE types are used. In one case I have a library which is intended to be loaded dynamically. For this library I provide a C++ header file which exposes an interface, and also provides the following: namespace my_dll_name { const ACE_TCHAR dll_name[] = "my_dll_name"; } This allows C++ clients to load my library without them having to hard-code the library name. I have just discovered, however, that the SWIG generated code for the dll_name constant is unusable for clients of this library, and so they actually do end up hard-coding the dll name in order to load the dll. I presume the previous developer knew about this, and simply ignored the issue, hwoever, I'd like to fix it. The problem is that I don't understand how to get swig to generate a correct wrapper for the ACE_TCHAR[] type. The wrapper generated by SWIG is unusable for C# clients, since it throws an exception (which I don't have a stack-trace for, despite pleading for one). I also don't have any kind of test application, or test harness for the C# wrappers, although I guess I'll need to create one. I would greatly appreciate any help in understanding potential problems with using ACE types with SWIG |