]> git.saurik.com Git - wxWidgets.git/blob - docs/tech/tn0010.htm
Attempt to fix buggy menus.
[wxWidgets.git] / docs / tech / tn0010.htm
1 <HTML>
2
3 <HEAD>
4 <TITLE>Compiling wxWindows applications in the VC++ IDE</TITLE>
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">
18 Compiling wxWindows applications in the VC++ IDE
19 </font>
20 </td>
21 </tr>
22 </table>
23
24 <P>
25
26 <CENTER>
27 <a href="#wxwin2">Settings for wxWindows 2</a> / <a href="#wxwin1">Settings for wxWindows 1.68</a>
28 </CENTER>
29
30 <P>
31
32 To compile wxWindows samples and applications using the VC++ 5.0 or 6.0 IDE (having compiled wxWindows
33 using the makefile or project file provided), the following
34 steps 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.
41 <li>Apply the settings listed below to the project, replacing c:\wx2 with your wxWindows
42 installation path.
43 </ol>
44
45 <P>
46
47 <H2><a name="wxwin2">Settings for wxWindows 2</a></H2>
48
49 These settings apply to wxWindows 2.1.14 and above.<P>
50
51 <DL>
52 <DT><B>General</B><DD>
53 The <B>Output files</B> and <B>Intermediate files</B> directory fields should be Debug
54 for the Debug configuration, and Release for the Release configuration.<P>
55
56 <DT><B>Debug: General</B><DD>
57 The <B>Executable for debug sessions</B> field should be altered to be the path and name
58 you'd expect (it may have generated a different name).<P>
59
60 <DT><B>C/C++: Preprocessor</B><DD>
61 The <B>Preprocessor definitions</B> field should contain the following symbols for Debug:<P>
62
63 <PRE>
64 WIN32,_DEBUG,_WINDOWS,__WINDOWS__,__WXMSW__,__WXDEBUG__,WXDEBUG=1,
65 __WIN95__,__WIN32__,WINVER=0x0400,STRICT
66 </PRE>
67 <P>
68 and these for Release:<P>
69
70 <PRE>
71 NDEBUG,WIN32,_WINDOWS,__WINDOWS__,__WXMSW__,__WIN95__,__WIN32__,
72 WINVER=0x0400,STRICT</PRE>
73 <P>
74 The <B>Additional include directories</B> field should contain the following:<P>
75 <PRE>
76 c:\wx2\include,c:\wx2\contrib\include
77 </PRE>
78 <P>(and of course any other directories you wish to use in your project).<P>
79
80 <DT><B>C/C++: Precompiled Headers</B><DD>
81
82 The <B>Not using precompiled headers</B> or <B>Automatic use of precompiled headers</B>
83 button should be selected.<P>
84
85 <DT><B>C/C++: Code Generation</B><DD>
86
87 The <B>Use run-time library</B> control should be set to <B>Debug Multithreaded DLL</B> (Debug)
88 or <B>Multithreaded DLL</B> (Release).<P>
89
90 <DT><B>Link: Input</B><DD>
91
92 The <B>Object/library modules</B> field should contain:
93
94 <PRE>
95 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
96 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib
97 winmm.lib wxd.lib xpmd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib
98 </PRE>
99
100 for the Debug configuration and
101
102 <PRE>
103 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
104 ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib
105 winmm.lib wx.lib xpm.lib png.lib zlib.lib jpeg.lib tiff.lib
106 </PRE>
107
108 for the Release configuration.<P>
109
110 The <B>Ignore libraries</B> field should contain:
111
112 <PRE>
113 libcd.lib,libcid.lib,msvcrt.lib
114 </PRE>
115
116 for the Debug configuration and
117
118 <PRE>
119 libc.lib,libci.lib,msvcrtd.lib
120 </PRE>
121
122 for the Release configuration.<P>
123
124 The <B>Additional library path</B> field should contain
125
126 <PRE>
127 c:\wx2\lib,c:\wx2\contrib\lib
128 </PRE>
129
130 for both Debug and Release configurations.
131
132 <P>
133
134 <DT><B>Resources</B><DD>
135
136 Select your .rc file. The <B>Additional resource include directories</B> field should contain:
137
138 <PRE>
139 c:\wx2\include;c:\wx2\contrib\include
140 </PRE>
141
142 </DL>
143
144 <HR>
145
146 <H2><a name="wxwin1">Settings for wxWindows 1.68</a></H2>
147
148 Note: these have not yet been checked.<P>
149
150 <DL>
151 <DT><B>Debug: General</B><DD>
152 The <B>Executable for debug sessions</B> field should be altered to be the path and name
153 you'd expect (it may have generated a different name).<P>
154
155 <DT><B>General</B><DD>
156 The <B>Output directories</B> fields can be made blank if you want the objects
157 and executable to be created in the project directory and not a subdirectory.<P>
158
159 <DT><B>C/C++: Preprocessor</B><DD>
160 The <B>Preprocessor definitions</B> field should contain the following symbols:<P>
161 <PRE>
162 WIN32,_DEBUG,_WINDOWS,wx_msw,DEBUG=1,WIN95=1,WINVER=0x0400,STRICT
163 </PRE>
164 <P>
165 The <B>Additional include directories</B> field should contain the following:<P>
166 <PRE>
167 ../../include/base,../../include/msw
168 </PRE>
169 <P>(and of course any other directories you wish to use in your project).<P>
170
171 <DT><B>C/C++: Precompiled Headers</B><DD>
172
173 The <B>Not using precompiled headers</B> or <B>Automatic use of precompiled headers</B>
174 button should be selected (I can't find a way of using the wxWindows PCH file).<P>
175
176 <DT><B>C/C++: Code Generation</B><DD>
177
178 The <B>Use run-time library</B> control should be set to <B>Multithreaded DLL</B>. This
179 sets the compiler switch to /MD to match the wxWindows makefile.<P>
180
181 <DT><B>Link: Input</B><DD>
182
183 The <B>Object/library modules</B> field should contain:
184
185 <PRE>
186 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
187 shell32.lib odbc32.lib odbccp32.lib comctl32.lib
188 ../../lib/wx.lib ../../src/msw/dummy.obj
189 </PRE>
190
191 The <B>Ignore libraries</B> field should contain:
192
193 <PRE>
194 libcd.lib,libcid.lib
195 </PRE>
196
197 <P>
198
199 <DT><B>Resources</B><DD>
200
201 Select your .rc file. The <B>Additional resource include directories</B> field should contain:
202
203 <PRE>
204 ..\..\include\msw;..\..\contrib\fafa
205 </PRE>
206
207 </DL>
208
209 <P>
210
211 <!--
212 <PRE>
213 From: "Chris Breeze" <chris@hel.co.uk>
214 To: <wxwin-users@wx.dent.med.uni-muenchen.de>
215 Subject: Re: Compiling 2.0 wxWin Apps in the VC IDE
216 Date: Wed, 20 May 1998 14:18:02 +0100
217
218 First the apology: the description below is for wx1.68
219 not for wx2.0 - sorry if I confused everybody.
220
221 Anyway, third time lucky I hope! The settings for
222 VC++ 5.0, wx2.0 beta 8, NT Workstation 4.0 sp3
223 are:
224
225 In project / settings / C/C++:
226 Add "__WINDOWS__" to the pre-processor definitions
227 Add "{wx}\include" to the additional include directories
228 where {wx} is the directory in which wx is installed
229
230 In project / settings / Resources:
231 add "{wx}\include" to the additional resource include directories
232
233 In project / settings / Link:
234 Add "wx.lib comctl32.lib dummy.obj" to the Object/Library modules
235
236 Add "libcd.lib,libcid.lib" to ignore libraries (under the "input" category)
237
238 Add "{wx}\lib,{wx}\src\msw" to the additional library path
239
240 I have tested these settings on samples/minimal and can
241 build exes which can be debugged using Developer Studio.
242
243 I hope I've finally answered the original question. (Next time
244 I'll read the question more carefully!).
245
246 Regards,
247 Chris
248
249 Original message (settings for wx1.68c):
250 ) Try the following (tested with VC++ 5 on NT4):
251 )
252 ) Create a new Win32 Application project and insert the source files
253 ) (including .rc files).
254 )
255 ) In project / settings / C/C++:
256 ) Add wx_msw to the pre-processor definitions
257 ) add {wx}\include\base,{wx}\include\msw to the additional include
258 directories
259 ) where {wx} is the directory in which wx is installed
260 )
261 ) In project / settings / Resources:
262 ) add {wx}\include\msw;{wx}\contrib\fafa to the additional resource include
263 ) directories
264 )
265 ) In project / settings / Link:
266 ) Add comctl32.lib wx.lib dummy.obj ctl3d32.lib to the Object/Library modules
267 )
268 ) Add libc to ignore libraries (under the "input" category)
269 )
270 ) Add {wx}\lib,{wx}\src\msw to the additional library path
271 )
272 ) These settings are for a debug build. You can use the same settings for
273 ) a release build apart from ignoring libc.
274
275 </PRE>
276 -->
277
278 </font>
279
280 </BODY>
281
282 </HTML>