Date: Wed, 22 Apr 2009 15:22:31 +0200 From: "Luca Cappa"
Subject: [Boost-users] unwanted exported symbols in a DLL which statically links to Boost.Library To: boost-users@lists.boost.org Message-ID: Hello, I am creating a DLL using the VisualC++ 8sp1, which statically links to Boost.Library, and also to another static library, which links to Boost.Library statically too.
In the export section of the built DLL I see, among the few public functions which it should export, hundreds of exported functions like the ones below. I would really like to export the symbols the DLL defines as exported, and not anything else which is unexpectly exported, like the ones shown below:
I'm not familiar with Boost's libs, but I am good with Windows, and DLL stuff in particular. So maybe I can offer some advice, which may be of help when combined with some information from others. I would agree that if the library containing those functions is static, it should not export anything. It's difficult to cause anything to be exported (nearly impossible for C++ decorated names, IME) other than by decorating the declaration of that function or variable, or the class containing it. On VC++, the decoration appears at the beginning and takes the form __declspec(dllexport) To unravel the macros and conditional compilation, pass one of the files through the preprocessor only. Do this in Visual Studio by opening the properties window for just the one CPP file (not the project itself). Under C/C++, Command Line, add the "/E" option, without the quotes, where you can type Additional Options. Then right-click on the filename in the solution explorer and choose to compile just that file. It won't actually compile, but it will produce another text file (I forget where it puts it). Change it back before Visual Studio gets confused. If "dllimport" is in that text somewhere, it is indeed doing that on purpose. TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.