xunzhang / gflags

Automatically exported from code.google.com/p/gflags
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Problem Build static lib for VS2008 #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add
   /D GFLAGS_DLL_DECL= /D GFLAGS_DLL_DECLARE_FLAG= /D GFLAGS_DLL_DEFINE_FLAG= 
   to the compile line of each .cc file and build libgflags. It produces a libgflags.dll, no libglags.lib. 
2. Add
   /D GFLAGS_DLL_DECLARE_FLAG= /D GFLAGS_DLL_DEFINE_FLAG=
   to gflags_unittest.cc and build gflags_unittest. 
LINK : fatal error LNK1181: Can not open input file 
'..\..\release\libgflags.lib'
3. If I do not add the lines to compile line, the project produces both dll and 
lib file for dynamic linking and work well.

What is the expected output? What do you see instead?
I want a statically-linked library, but I can't get it. Is anything wrong in my 
steps?

What version of the product are you using? On what operating system?
gflags-1.7, Windows XP sp3

Please provide any additional information below.

Original issue reported on code.google.com by Fallwi...@gmail.com on 16 Jan 2012 at 7:43

GoogleCodeExporter commented 9 years ago
Isn't there a setting you set on the compiler to produce a static library?  I 
don't know anything about windows compilation.  The /D flags are just things 
you need to do in addition to the normal process, to get the code to compile 
when you are trying to compile a static lib.  You still need to do whatever the 
incantation is to your windows compiler, to get it to build a static library.

Original comment by csilv...@gmail.com on 17 Jan 2012 at 7:27