Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf ·...
Transcript of Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf ·...
![Page 1: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/1.jpg)
Step Slide # Contents
1 2 Install TDM MinGW
2 8 Check Windows Path Variable
3 10 Confirm gcc -v installation
4 11 Download & Run wxWidgets Installer
5 15 Build wxWidgets library
6 21 Download & install Code::Blocks IDE
7 23 Create wxWidgets Project
8 27 Set wxWidgets Location
9 31-34 Every Project: set libwxmsw31u.a location (maybe – see details)
10 35 Build and run Project
Install and build MinGW and wxWidgets
Slide 1
Updated Version 20200515
![Page 2: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/2.jpg)
Install TDM MinGW GCC Compiler
Slide 2
Note: This is TDM -GCC 5.1
![Page 3: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/3.jpg)
Slide 3
Download theWin32api installer
Download URL:https://jmeubank.github.io/tdm-gcc/download/
![Page 4: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/4.jpg)
Create a new installation
Slide 4
![Page 5: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/5.jpg)
64it install
Slide 5
![Page 7: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/7.jpg)
1. Confirm installedproperly
Slide 7
![Page 8: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/8.jpg)
Slide 8
Windows->Computer(Rt Click)->Properties->
Advanced system settings->System Properties->
Environment Variables
2. Check the Windows Path environment variableNOT NECESSARYARCHIVE ONLYto include path to Select options below
Not necessary withTDM-GCC64 Install
![Page 9: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/9.jpg)
Slide 9
Make sure there is noother conflicting path toC:\MinGW within the 'Path' value
This should be automaticwith the TDM-GCC install
Not necessary withTDM-GCC64 InstallARCHIVE ONLY – NOT NECESSARY
![Page 10: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/10.jpg)
Go to command prompt 'cmd' and confirm that gcc is installed and PathVariable is correctly set
Enter 'gcc -v' as command – get response below
Slide 10
Test the GCC installation – ‘gcc -v’
![Page 11: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/11.jpg)
Download wxWidgets
Slide 11
![Page 12: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/12.jpg)
Installer
Slide 12
![Page 13: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/13.jpg)
Slide 13Run the wxWidgets 3.1.x installer
![Page 14: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/14.jpg)
Slide 14
Make sure the installationIs into the root directoryi.e. 'C:'
![Page 15: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/15.jpg)
Follow instructionsto build wxWidgets
Slide 15
![Page 16: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/16.jpg)
Change to the C:\wxWidgets-3.1.0\build\msw folderthen click on the navigation bar to get full path
Slide 16
![Page 17: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/17.jpg)
Copy this path and paste into cmd windowto change cmd window to this folder location
Slide 17
1. open command prompt2. enter cd3. then right click mouse and paste the full path to the \build\msw folder4. press enter to change to that folder
![Page 18: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/18.jpg)
Taken from Instructions for wxWidgets build
http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef
Slide 18
First Clean all the wxWidgets code
C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release clean
Then Build with this instruction:
C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release
use these instructions to build wxWidgets library – each one is a single command line
each one is a single command line
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release clean
AND
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release
![Page 19: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/19.jpg)
Slide 19
Command line to start library build….see previous slide for details
This process can take 30-45 minutes on a current computerMaybe longer - Make sure the process runs to completion…..
![Page 20: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/20.jpg)
Build complete
Slide 20
![Page 21: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/21.jpg)
Slide 21
2. Download and install Code::Blocks IDE onlyhttp://www.codeblocks.org
1. If you have a previous Code::BlocksInstallation – Delete the old one first!
3. Running the installer
![Page 22: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/22.jpg)
Slide 22
1. First time only - Start Code::Blocks2. Select:Settings->Compiler->Toolchain executables
3. MAKE sure that the properGCC directory is detected
![Page 23: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/23.jpg)
Code::Blocks – create a wxWidgets project Slide 23
1.
2.
![Page 24: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/24.jpg)
Slide 24Current will show wxWidgets 3.1.x – choose that
![Page 25: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/25.jpg)
Slide 25Create your own CodeBlocks folder to contain ALL your projects
![Page 26: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/26.jpg)
Slide 26
Make the project'Frame Based'
![Page 27: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/27.jpg)
Slide 27FIRST TIME ONLY – you may see this: Browse to location for wxWidgets-3.1.X
You will encounter the following dialogs
Ignore warnings and proceed
1. Browse to location
2. Close Window
3. Yes
![Page 28: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/28.jpg)
Browse to folderFor wxWidgets
Slide 28
Or whatever versionwxWidgets is installed
![Page 29: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/29.jpg)
Slide 29
Release version only – no Debug library was built
![Page 30: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/30.jpg)
Select same options as wxWidgets library was compiled with, i.e.mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release
Slide 30
![Page 31: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/31.jpg)
Slide 31
For ARCHIVE Only – NOT NECESSARY Code::Blocks project wizard is expectingwxWidgets 3.0.2, but wxWidgets 3.1.0 MUST be usedWill have to specifiy so linker can find – the answer is to ignore at this point
Not necessary if wizard showed proper version of wxWidgets (see slide 24)
![Page 32: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/32.jpg)
Slide 32ARCHIVE ONLY – NOT NECESSARY
1. Rt. Click Project->Build Options->Linker Settings2. Edit library settings3. Browse to correct library
Not necessary if wizard showed proper version of wxWidgets (see slide 28)
![Page 33: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/33.jpg)
Slide 33ARCHIVE ONLY – NOT NECESSARY
NO
Not necessary if wizard showed proper version of wxWidgets (see slide 24)
![Page 34: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/34.jpg)
Slide 34
Proper selection of library locationC:\wxWidgets-3.1.0\lib\gcc_dll\libwxmsw31u.a
NOT NECESSARY if wizard showed proper version of wxWidgets (see slide 24) ARCHIVE ONLY
![Page 35: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/35.jpg)
Build
Slide 35
Note: 0 errors – so ok to run
![Page 36: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/36.jpg)
Too many warnings? Turn them off
1. Right click project
2. Select Build Options
3. Compiler flags
4. Turn off warnings
Slide 36
![Page 37: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/37.jpg)
Slide 37
Original lines 73-75
Modify original code - to show Time and Date CreateStatusBar(1);// SetStatusText(_("Hello Code::Blocks user!"),0);// SetStatusText(wxbuildinfo(short_f), 1); SetStatusText("Hello its " + wxDateTime::Now().Format("%c using " + wxbuildinfo(short_f)),0);
![Page 38: Install and build MinGW and wxWidgetsweb.eng.fiu.edu/watsonh/eel3370/InstallMinGW20200515.pdf · 5/15/2020 · C:\wxWidgets-3.1.0\build\msw>mingw32-make -f makefile.gcc SHARED=1](https://reader033.fdocuments.us/reader033/viewer/2022052616/60aae2e8fe05180d3c7b1aa7/html5/thumbnails/38.jpg)
Slide 38
Run theprogram
Make sure time and date show