]> git.saurik.com Git - wxWidgets.git/blame - docs/tech/tn0010.htm
Open and Close clipboard properly
[wxWidgets.git] / docs / tech / tn0010.htm
CommitLineData
f6bcfd97
BP
1<HTML>
2
3<HEAD>
fc2171bd 4<TITLE>Compiling wxWidgets applications in the VC++ IDE</TITLE>
f6bcfd97
BP
5
6</HEAD>
7
8<BODY BGCOLOR="#FFFFFF" TEXT=#000000 LINK=#FF0000 VLINK=#000000>
9
10<font face="Arial, Lucida Sans, Helvetica">
11
12<a name="top"></a>
13
14<table width=100% border=0 cellpadding=5 cellspacing=0>
15<tr>
16<td bgcolor="#C4ECF9">
17<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#000000">
fc2171bd 18Compiling wxWidgets applications in the VC++ IDE
f6bcfd97
BP
19</font>
20</td>
21</tr>
22</table>
23
24<P>
25
26<CENTER>
fc2171bd 27<a href="#wxwin2">Settings for wxWidgets 2.2</a> / <a href="#wxwin1">Settings for wxWidgets 1.68</a>
f6bcfd97
BP
28</CENTER>
29
30<P>
31
fc2171bd 32To compile wxWidgets samples and applications using the VC++ 5.0 or 6.0 IDE (having compiled wxWidgets
f6bcfd97
BP
33using the makefile or project file provided), the following
34steps and settings should be used.<P>
35
36<H2>Steps</H2>
37
38<ol>
39<li>Create a new WIN32 Application project.
40<li>Add the .cpp and .rc files for your project.
fc2171bd 41<li>Apply the settings listed below to the project, replacing c:\wx2 with your wxWidgets
f6bcfd97
BP
42installation path.
43</ol>
44
45<P>
46
fc2171bd 47<H2><a name="wxwin2">Settings for wxWidgets 2.2</a></H2>
f6bcfd97 48
fc2171bd
JS
49These settings apply to wxWidgets 2.1.14 and above but most of them are not
50necessary any longer for wxWidgets 2.3+.<P>
f6bcfd97
BP
51
52<DL>
53<DT><B>General</B><DD>
54The <B>Output files</B> and <B>Intermediate files</B> directory fields should be Debug
55for the Debug configuration, and Release for the Release configuration.<P>
56
57<DT><B>Debug: General</B><DD>
58The <B>Executable for debug sessions</B> field should be altered to be the path and name
59you'd expect (it may have generated a different name).<P>
60
61<DT><B>C/C++: Preprocessor</B><DD>
62The <B>Preprocessor definitions</B> field should contain the following symbols for Debug:<P>
63
64<PRE>
65WIN32,_DEBUG,_WINDOWS,__WINDOWS__,__WXMSW__,__WXDEBUG__,WXDEBUG=1,
a71d815b 66__WIN32__,WINVER=0x0400,STRICT
f6bcfd97
BP
67</PRE>
68<P>
69and these for Release:<P>
70
71<PRE>
a71d815b 72NDEBUG,WIN32,_WINDOWS,__WINDOWS__,__WXMSW__,__WIN32__,
f6bcfd97
BP
73WINVER=0x0400,STRICT</PRE>
74<P>
75The <B>Additional include directories</B> field should contain the following:<P>
76<PRE>
cf8e0957 77c:\wx2\include
f6bcfd97 78</PRE>
2edb0bde 79<P>(and of course any other directories you wish to use in your project).<P>
f6bcfd97
BP
80
81<DT><B>C/C++: Precompiled Headers</B><DD>
82
83The <B>Not using precompiled headers</B> or <B>Automatic use of precompiled headers</B>
84button should be selected.<P>
85
86<DT><B>C/C++: Code Generation</B><DD>
87
88The <B>Use run-time library</B> control should be set to <B>Debug Multithreaded DLL</B> (Debug)
89or <B>Multithreaded DLL</B> (Release).<P>
90
91<DT><B>Link: Input</B><DD>
92
93The <B>Object/library modules</B> field should contain:
94
95<PRE>
96kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
97ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib
fc2171bd 98winmm.lib wxmsw25d.lib wxbase25d.lib wxpngd.lib wxzlibd.lib wxjpegd.lib wxtiffd.lib
f6bcfd97
BP
99</PRE>
100
101for the Debug configuration and
102
103<PRE>
104kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
105ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib
fc2171bd 106winmm.lib wxmsw25.lib wxbase25.lib wxpng.lib wxzlib.lib wxjpeg.lib wxtiff.lib
f6bcfd97
BP
107</PRE>
108
109for the Release configuration.<P>
110
111The <B>Ignore libraries</B> field should contain:
112
113<PRE>
114libcd.lib,libcid.lib,msvcrt.lib
115</PRE>
116
117for the Debug configuration and
118
119<PRE>
120libc.lib,libci.lib,msvcrtd.lib
121</PRE>
122
123for the Release configuration.<P>
124
125The <B>Additional library path</B> field should contain
126
127<PRE>
cf8e0957 128c:\wx2\lib
f6bcfd97
BP
129</PRE>
130
131for both Debug and Release configurations.
132
133<P>
134
135<DT><B>Resources</B><DD>
136
137Select your .rc file. The <B>Additional resource include directories</B> field should contain:
138
139<PRE>
cf8e0957 140c:\wx2\include
f6bcfd97
BP
141</PRE>
142
143</DL>
144
145<HR>
146
fc2171bd 147<H2><a name="wxwin1">Settings for wxWidgets 1.68</a></H2>
f6bcfd97
BP
148
149Note: these have not yet been checked.<P>
150
151<DL>
152<DT><B>Debug: General</B><DD>
153The <B>Executable for debug sessions</B> field should be altered to be the path and name
154you'd expect (it may have generated a different name).<P>
155
156<DT><B>General</B><DD>
157The <B>Output directories</B> fields can be made blank if you want the objects
158and executable to be created in the project directory and not a subdirectory.<P>
159
160<DT><B>C/C++: Preprocessor</B><DD>
161The <B>Preprocessor definitions</B> field should contain the following symbols:<P>
162<PRE>
a71d815b 163WIN32,_DEBUG,_WINDOWS,wx_msw,DEBUG=1,WINVER=0x0400,STRICT
f6bcfd97
BP
164</PRE>
165<P>
166The <B>Additional include directories</B> field should contain the following:<P>
167<PRE>
168../../include/base,../../include/msw
169</PRE>
2edb0bde 170<P>(and of course any other directories you wish to use in your project).<P>
f6bcfd97
BP
171
172<DT><B>C/C++: Precompiled Headers</B><DD>
173
174The <B>Not using precompiled headers</B> or <B>Automatic use of precompiled headers</B>
fc2171bd 175button should be selected (I can't find a way of using the wxWidgets PCH file).<P>
f6bcfd97
BP
176
177<DT><B>C/C++: Code Generation</B><DD>
178
179The <B>Use run-time library</B> control should be set to <B>Multithreaded DLL</B>. This
fc2171bd 180sets the compiler switch to /MD to match the wxWidgets makefile.<P>
f6bcfd97
BP
181
182<DT><B>Link: Input</B><DD>
183
184The <B>Object/library modules</B> field should contain:
185
186<PRE>
187kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
188shell32.lib odbc32.lib odbccp32.lib comctl32.lib
189../../lib/wx.lib ../../src/msw/dummy.obj
190</PRE>
191
192The <B>Ignore libraries</B> field should contain:
193
194<PRE>
195libcd.lib,libcid.lib
196</PRE>
197
198<P>
199
200<DT><B>Resources</B><DD>
201
202Select your .rc file. The <B>Additional resource include directories</B> field should contain:
203
204<PRE>
cf8e0957 205..\..\include\msw
f6bcfd97
BP
206</PRE>
207
208</DL>
209
f6bcfd97
BP
210</BODY>
211
212</HTML>