~ubuntu-branches/debian/squeeze/protobuf/squeeze

« back to all changes in this revision

Viewing changes to vsprojects/readme.txt

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2009-06-02 16:19:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090602161900-vm176i3ryt35yk91
Tags: 2.0.3-2.2
* Non-maintainer upload.
* Fix FTBFS from -2.1: don't fail when we can't clean up the java build,
  such as when openjdk isn't installed.
* Disable parallel builds, because libtool is made of fail (if binary-arch
  and build-indep run concurrently, we relink a library while it's being
  used; that doesn't work so well).

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
========================
8
8
 
9
9
1) Open protobuf.sln in Microsoft Visual Studio.
10
 
2) Choose "Debug" or "Release" configuration as desired.
 
10
2) Choose "Debug" or "Release" configuration as desired.*
11
11
3) From the Build menu, choose "Build Solution".  Wait for compiling to finish.
12
12
4) From a command shell, run tests.exe and check that all tests pass.
13
13
5) Run extract_includes.bat to copy all the public headers into a separate
14
14
   "include" directory (under the top-level package directory).
15
15
6) Copy the contents of the include directory to wherever you want to put
16
16
   headers.
17
 
7) Copy protoc.exe and the two DLLs (libprotobuf and libprotoc) wherever you
18
 
   put build tools.
19
 
8) Copy libprotobuf.{lib,dll} and libprotoc.{lib,dll} wherever you put
20
 
   libraries.
21
 
 
22
 
DLLs and Distribution
23
 
=====================
 
17
7) Copy protoc.exe wherever you put build tools (probably somewhere in your
 
18
   PATH).
 
19
8) Copy libprotobuf.lib and libprotoc.lib wherever you put libraries.
 
20
 
 
21
* To avoid conflicts between the MSVC debug and release runtime libraries, when
 
22
  compiling a debug build of your application, you may need to link against a
 
23
  debug build of libprotobuf.lib.  Similarly, release builds should link against
 
24
  release libs.
 
25
 
 
26
DLLs vs. static linking
 
27
=======================
 
28
 
 
29
Static linking is now the default for the Protocol Buffer libraries.  Due to
 
30
issues with Win32's use of a separate heap for each DLL, as well as binary
 
31
compatibility issues between different versions of MSVC's STL library, it is
 
32
recommended that you use static linkage only.  However, it is possible to
 
33
build libprotobuf and libprotoc as DLLs if you really want.  To do this,
 
34
do the following:
 
35
 
 
36
  1) Open protobuf.sln in MSVC.
 
37
  2) For each of the projects libprotobuf and libprotoc, do the following:
 
38
    2a) Right-click the project and choose "properties".
 
39
    2b) From the side bar, choose "General", under "Configuration Properties".
 
40
    2c) Change the "Configuration Type" to "Dynamic Library (.dll)".
 
41
    2d) From the side bar, choose "Preprocessor", under "C/C++".
 
42
    2e) Add PROTOBUF_USE_DLLS to the list of preprocessor defines.
 
43
  3) When compiling your project, make sure to #define PROTOBUF_USE_DLLS.
24
44
 
25
45
When distributing your software to end users, we strongly recommend that you
26
46
do NOT install libprotobuf.dll or libprotoc.dll to any shared location.
27
47
Instead, keep these libraries next to your binaries, in your application's
28
48
own install directory.  C++ makes it very difficult to maintain binary
29
49
compatibility between releases, so it is likely that future versions of these
30
 
libraries will *not* be usable as drop-in replacements.  The only reason we
31
 
provide these libraries as DLLs rather than static libs is so that a program
32
 
which is itself split into multiple DLLs can safely pass protocol buffer
33
 
objects between them.
 
50
libraries will *not* be usable as drop-in replacements.
34
51
 
35
52
If your project is itself a DLL intended for use by third-party software, we
36
53
recommend that you do NOT expose protocol buffer objects in your library's
37
54
public interface, and that you statically link protocol buffers into your
38
55
library.
39
56
 
40
 
TODO(kenton):  This sounds kind of scary.  Maybe we should only provide static
41
 
  libraries?
42
 
 
43
57
Notes on Compiler Warnings
44
58
==========================
45
59
 
58
72
C4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
59
73
C4996 - 'function': was declared deprecated
60
74
 
61
 
C4251 is of particular note.  The protocol buffer library uses templates in
 
75
C4251 is of particular note, if you are compiling the Protocol Buffer library
 
76
as a DLL (see previous section).  The protocol buffer library uses templates in
62
77
its public interfaces.  MSVC does not provide any reasonable way to export
63
78
template classes from a DLL.  However, in practice, it appears that exporting
64
79
templates is not necessary anyway.  Since the complete definition of any