Most people don't care about using gtest as a DLL. For them, we don't
want to clutter the source code with lots of GTEST_API macros.
If possible, I'd like to avoid having to maintain a DLL API. What's
the benefit you are looking after by building gtest as a DLL? If it's
memory, how much memory do you estimate you can save by going DLL?
Thanks,
>
>
> On 18 juin, 04:46, Vlad Losev <vladlo...@gmail.com> wrote:
>> On Tue, Jun 16, 2009 at 3:02 AM, podi...@gmail.com <podi...@gmail.com>wrote:
>>
>>
>>
>> > I need to compile gtest as a DLL. There is no dllexport in current
>> > version so it's impossible to link it with my executable.
>>
>> > Does anyone made the changes to compile it as a DLL?
>>
>> At Google we only use gtest in static libraries and don't have projects to
>> build DLLs. We may end up having DLL builds, but we have a lot of other
>> stuff on our hands now, and may not get around to do it soon. :-(
>>
>> But if you absolutely have to build gtest as a DLL, an easier way to do it
>> is to add a module definition
>> file<http://msdn.microsoft.com/en-us/library/28d6s79h%28VS.80%29.aspx>to
>> the gtest project and use it to export all the symbols that the linker
>> reports missing. Let us know if you succeed in that and feel free to
>> contribute back to the project. :-)
>>
>> Regards,
>> Vlad
>
--
Zhanyong
Zhanyong,
I literally spent a month trying to get it to work without having
it be a .dll. I did not succeed. I can't remember all the
gyrations I went through during this process.
Anyway, let me try to explain this...
First, there is no such thing as gtest.lib => msrt.dll.
Just like on unix, a .lib is an archive of objects, with no
dependencies.
Here's the confiration.
myLibOne => thirdPartyOne.dll, (the only thing available)
myLibTwo => thirdPartyOne.dll
myTestsOne => gtest.lib, thirdPartyOne.dll
myTestsTwo => gtest.lib, thirdPartyOne.dll
myExeWithTests.exe => myLibOne, oyLibTwo, myTestsOne, myTestsTwo,
gtest.lib, thirdPartyOne.dll, msrt.dll