Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Mime-Version: 1.0 (Apple Message framework v612) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed To: cygwin AT cygwin DOT com From: Niklas Wallin Subject: Creating DLL's for use with MSVC Date: Wed, 10 Mar 2004 08:59:26 +0100 X-IsSubscribed: yes We are currently porting a linux C++ project to windows. The project consists of several dll's (or .so's). To recreate those dll's in Windows it seems like you have to add a lot of __cdecls definitions or use a definitions file. Neither method is appealing to us. So, I read somewhere that Cygwin might do the trick by exporting all symbols. So, I started to compile dll's in cygwin: c++ -shared -mno-cygwin -o mydll.dll mydll.cpp \ -Wl, --out-implib=mydll.lib -W1,--output-def=mydll.def -W1,--export-all-symbols The problem was that I could not link my MSVC program with the import library, since the symbols are decorated differently. Cygwin (and I guess Linux) creates symbols like "_ZN7Myclass8GetValueEv" while MSVC looks for "?getValue AT MyClass@@QAEHXZ". The definitions file was correct however. Then I read somewhere that you should produce the import library from the def file using MS lib: lib /machine:i386 /def:mydll.def This did not work either, the symbols are of course decorated the same way (cygwin way). I have also tried to use the dllwrap and dlltool but all I got was empty def files, and undefined references. Please tell me I that I actually can create DLL's in Cygwin and link them with MSVC. If you do that can you please tell me how. I spent yesterday reading and reading, compiling and linking but without any success. / Niklas -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/