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