Hi Graham. After you compile wxWidgets, you need to fine tune your build. Go to the lib directory. There is a VC_mswd or VC_mswud folder, depending on whether you built the toolkit with just debug or unicode debug. In either tirectory, there is a subdirectory called wx and the wx.h settings file is in there. Open it and run through the flags, enabling or disabling whatever you need or not need, as the case may be. Look for the ODBC option and check if it is enabled. Enable it if you so wish. Cheers! ----- Original Message ----- From: "Graham Hardy" <graham.hardy@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx> Sent: Monday, November 26, 2007 11:46 AMSubject: RE: tutorials for compilation of wxWidgets on windows -- part 1, erata
Hi all,Firstly, I absolutely love the sound of these libraries, and many thanks toJaffar and others for bringing this to our attention, and to Jaffar for writing this quick tutorial. (Jaffar, I actually got this to compile with the Microsoft C++ compiler!) The only problem I am experiencing is this: A lot of the sample programs were giving me an error about not finding a library called odbc32.lib. Naturally, I went and rebuilt the system, this time enabling the ODBC setting in config.vc. However, it still cannot find this file. Do you know whether I am doing anything wrong? Many thanks, Graham. -----Original Message----- From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of jaffar Sent: November 25, 2007 3:19 AM To: programmingblind@xxxxxxxxxxxxxSubject: tutorials for compilation of wxWidgets on windows -- part 1, erataHi. Here is a revised version of part 1 of my wxWidgets compilation onwindows tutorial. I made some errors during the writing of the tutorial thefirst time, so ignore that and concentrate on this correct one instead. There is also additional info that i thought i should include with it. Hi all. As an unbiased approach towards writing these tutorials on compiling wxWidgets on windows, I thought I'll write them up on my experiences based on the 3 most used C/c++ compilers, Vc++, BCC and Gcc using the MinGW environment. This is also an intro for those of you who might be interested in exploring the possibilities of venturing into this great open source programming resource. Please note that my emphasis here will be on WxWidgets itself, Not on it's derivatives such as wxPython orwxPerl, but the main wxWidgets which is the C++ framework or toolkit. Alsonote that i am not going to instruct you in it's use as the teaching of itis well documented on it's website, but concentrate solely on it's build andcompilation, particularly from the command line as i think personally that this would be the shortest and most time effective approach. Introduction. What is wxWidgets? Like MFC, it is a c++ framework or toolkit whichprovides you with wrappers, classes and libraries to build a Windows programwith c++. Unlike MFC though, it is free, open source and cross platform,meaning that you could program, for example, Windows GUIS on unix, then port it to Microsoft Windows and vice versa, then give it a native look and feel.For more info on WXWidgets, please refer to: http://www.wxwidgets.org For instructions on it's usage, please go to www.wxwidgets.org/wiki fromwhere you can get a wealth of documentation and reference these tutorials aswell. Please note the the use of wxWidgets is governed by the wxWindows license version 3.1 which allows you to create both open source and commercial apps with wxWidgets without any limitation as long as acknowledgement of the fact that the app was built with wxWidgets is forthcoming from you the vendor. As of this writing, the latest stable version of wxWidgets that is recommended for download and use is version2.8.6.However, if you are not of the faint hearted and would like to try and test out unstable and buggy code, but endowed with the latest features, you could try getting the nightly snapshot from it's cvs branch. I wouldn't recommendthis cause of action to any novice though, and I wouldn't want to be responsible for ensuing headaches or system aches as the case might be, so exercise caution and really make sure you know what you're doing before pursuing this cause of action. WxWidgets comes in many flavors as would be expected out of it's cross platform nature. there is wxWidgets for Motif, WxWidgets for x11, WxWidgets for os2 and I could go on. But what we are primarily interested in, in this scenario isWxWidgets.exe which is a typical windows executable binary, and WXAll whichhas versions of all the platforms it covers in one zip or bz2 file. To obtain either of this, go to http://www.wxwidgets.org/downloads and follow either the links which say sourceforge or UK Mirror. I highlyrecommend the UK mirror as it is much faster and you don't have to wait forpage download time which could be very irksome in the case of the SourceForge website. You could also follow the direct version link, but that will take you to Sourceforge. In any case, choose which ever binary suits your needs. If you are more comfortable with the standard windows installation procedure, choose the wxWidgets-2.8.6.exe which would install wxWidgets like all other typical windows installers to your hard drive. Note that it will also install all associated help files and appropiate documentation along with the source. Please take note however that the installation doesn't set any environment variables for you, which you must do yourself, and i will deal with that a little later. If you choose to download the WXAll zip source files and install and build it yourself, then please pay close attention as we have really come to themeat of the subject. Even for those of you who downloaded the .exe binary,pleas do not skip the following part of the tutorial as knowledge onbuilding your sample and demo apps found in the distribution file is heavilyreliant on what you've learnt from hereon. WXWidgets building tools. Along with the zipped source distribution of wxWidgets, You'll need one of the following tools to build and install wxWidgets onto your hard drive.However, if you want different variants of the windows flavored wxWidgets onyour pc, there is nothing to stop you from obtaining all of the tools mentioned here. 1. VCExpress accompanied by the windows platform SDk which you can obtainfreely from the Microsoft website. (note: If you have any other version ofthe MSVC other than the VCExpress, then you need not worry about the Platform SDK as these are fully provided with it's own C++ Compilation tools).2. The older versions of the borland ide and compiler which you can obtainfrom the Borland site (Note that the download sites for these are ratherobscure and the best way to pinpoint their location is by doing a search ongoogle or your favorite search engine). 3. MinGW which you can obtain from the MinGW site, http://www.mingw.org With MinGW, you can choose to compile in a unix-like environment by obtaining the following additional tools: i. MSYS, a unix style shell command utility which you can locate at the MinGW site. ii. Cygwin, http://www.cygwin.org which actually comes with it's own gcc compilers.If you compiled and build wxWidgets with Microsoft's Visual Studio 6.0, 7.0, 7.1 or 8.0, You'll get a VC build of wxWidgets. If you install and build itwith borland and/or MinGW on the other hand, you'll get a BCC and a GCC build respectively. Caution: Visual Studio 7.0 has been found to be very buggy when used tobuild wxWidgets. I wouldn't recommend this particular version but 6.0, 7.1 or 8.0 instead. The older versions of the GCC compiler has also been shownnot to have work well. My recommendation is for you to download the most current version. Going the VC way.Having obtained wxWidgets and your building tools of choice, it is now timefor us to start building your WxWidgets sources. Here are the detailed steps.1. Unzip your source distribution of wxWidgets to a convenient location onyour hard drive. I would typically unzip mine to c:\wxWidgets-2.8.6. In all cases, the path folder has already been set for you, and it is just a matter of choosing the drive that is most convenient to you. I have alsodeleted the unnecessary version number found in the path, and since it stillworks, c:\wx would save you lots of memory loss time.2. Having unzipped your files into the set folder, the folder tree of yourwx distribution would now typically look like this: main folder: c:\wx subfolders: art, build, contrib, demos, distrib, docs, include, lib, locale, misc, samples, src and a few more which are of no concern to us at this stage.The most important subdirectory you have to concern yourself with for now is the build directory. If you browse it, you will find the necessary folders which will influence your build of wxWidgets. Concentrate on the msw folderfor now. 3. Browse the msw folder. you will find a file called config.vc. This istypically a configure file or tool that you can configure to achieve a VC++build of wxWidgets which is to your liking. Open up the file by changing it's extension to, for example, config.vc.txt. You might get a message telling you that by changing a file extension, you will render it unusableor some such. Ignore it. You can now open the file with notepad and accessit's contents. Change the configurable flags in the file to suit your needs. For example, set unicode build of wxWidgets to 1 if you want a unicode build, 0 for ascii. Set the ODBC library flag to 1 if you want to include the ODBC library in your build, set it to 0 for no. Just pay attention toany of the default settings and tweak as and when you need. Also take note that a dynamic build will produce DLLS and a static build will result in Lib or library files which you would need to link to your apps. Also take noteof the debug or release versions of the wxWidgets that is possible for youto build. Once you are satisfied with your configuration, save the file and close. don't forget to rename the file back to makefile.vc. If you want to refine your vc build. you can do so by opening the wx_setup.h file found in the include folder. Follow the same steps as above to access and configurethat file. 4.Set up the environment path. Although there are some tools to help withthis, I have found that setting up the environment path by hand is the mostsafest and surest way of doing it. Here are the steps.I. Set your WXWIN path by first going to your my computer selection on your desktop. Press your right context menu key to bring up the various submenuselections. Arrow up once to properties where you'll land on the general tab of the properties pages. Arrow right to advanced, then tab until you hear the tab button being announced. Press the space bar to get into theenvironment page. You will land on the user environment list, tab again tonew and press the space bar. the first edit field you'll encounter is theuser variable. type in "WXWIN" without the quotation marks. Tab once more,now to the value edit field, type in the location of your wx folder, in my case, c:\wx. Press ok. II. Now tab to the system variable list. Choose path with the down arrow key, then tab to the I for edit button. Press the space bar and you'll bepresented with an edit field with a line of system variable paths separatedby semicolons. Check if your Visual studio and your platform SDK bin directories are there. This is especially important if you are buildingwith VCExpress. If not, type them at the end of the list like this. Firstput a semicolon after your last entry, then add the path to the mentionedbin directories, typically ;C:\Program Files\Microsoft Platform SDK r2\Bin. Please note that if you are using VCExpress, then the sdk bin directory mustcome after the VCExpress directory. Press ok 3 times. The paths are now set. BuildingAfter all the priliminary ground work, it is now time to get building. Openthe command prompt. CD to the folder where vcvars32.bat (if you are using VC++8.0 other than the express version), is located, and setenv.cmd (if VC++youare using VC++Express with the platform SDK), is located. Typically, these would be %program files\microsoft Platform SDK r2% for setenv.cmd, %programfiles\microsoft visual studio8\tools\bin for vcvars32.bat. These will set up the appropriate environments to build your wxWidgets distribution. Youcould copy both files to your C:\ drive if it helps, which i personally havedone. If everything went well, if all instructions were observed, you can now have a working version of wxWidgets by issuing the following commands. CD c:\ Vcvars32.bat (if you copied this file there.) A message will tell you in essence that the microsoft visual studio tools environment has been set.now cd to c:\wx\build\msw. When the prompt confirms your presence in there, type nmake /f makefile.vc build=optimise. Your build will now begin. Therewill be lots of output which you can ignore, unless the debugger stops midway with some fatal error warnings. But if you have followed the instructions above, you'll find that your source will compile and buildfine. The same will occur if you used setenv.cmd, except that this time, itwill set the platform SDK environment.A successful build of a unicode-debug version of wxWidgets will yield you adirectory in the msw directory tree called VC_mswud which will be full of obj files that you can clean using the clean command. Also, if you browse the lib directory, another VC_mswud directory of lib files would have beencreated for you. These are the runtime libraries that are issential for youto link against your wxWidgets built apps. To test if your build works propperly, CD to the sample directory like this: cd c:\wx\samples\access, for example, then issue the makefile command. If it builds correctly, then congratulations, you have a working wxWidgets distribution. If you have any questions, feell free to ask. The borland and the MinGW build tutorials will follow in the next 2 to 3 days, depending on my work schedule. All thoughts on this little tutorial are welcomed. Cheers! __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________View the list's information and change your settings at //www.freelists.org/list/programmingblind