1) Removed the MS SDK for Windows 7, and the additional stuff that gets installed with it. Then using a suite of utilities, cleaned the disk of junk files, and cleaned my registry of the ~282 junk entries left behind.
2) Navigated to
http://www.codeblocks.org/downloads/26. Downloaded the codeblocks-13.12minggw-setup.exe and performed a "full install" of the same.
3) Then I ensured the mingw path was properly added to WIndows by following the wiki at :
http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef4) I downloaded wxWidgets by following this verbiage and the embedded link on this same wiki: "... The
current recommended version of wxWidgets to use is 2.8.12. Click
here to download the wxWidgets 2.8.12 sources for Windows (wxMSW-2.8.12-Setup.exe; 12.2 MB...." I installed the same taking all the defaults in the installer.
5) In building wxWidgets in this same wiki...I installed my preferences in the config.gcc file...instead of passing it on the cli. Purpose: So I don't have to remember the exact cli for clean operations. File is included below.
//------------------------------------------------------
# =========================================================================
# This configuration file was generated by
# Bakefile 0.2.9 (http://www.bakefile.org)
# Beware that all changes made to this file will be overwritten next
# time you run Bakefile!
# =========================================================================
# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------
# Compiler flags to link shared library
LINK_DLL_FLAGS ?= -static
# Compiler flags to link loadable module
LINK_MODULE_FLAGS ?= -static
# C compiler
CC = gcc
# C++ compiler
CXX = g++
# Standard flags for CC
CFLAGS ?=
# Standard flags for C++
CXXFLAGS ?= -fno-keep-inline-dllexport
# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=
# Standard linker flags
LDFLAGS ?=
# The C preprocessor
CPP ?= $(CC) -E
# What type of library to build? [0,1]
SHARED ?= 0
# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0
# Compile Unicode build of wxWidgets? [0,1]
UNICODE ?= 0
# Use MSLU library when building Unicode version. [0,1]
MSLU ?= 0
# Type of compiled binaries [debug,release]
BUILD ?= release
# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default
# Should __WXDEBUG__ be defined? The default value "default" means that it will
# be defined if BUILD=debug and not defined if BUILD=release. [0,1,default]
DEBUG_FLAG ?= default
# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 1
# Build GUI libraries? [0,1]
USE_GUI ?= 1
# Build wxHTML library (USE_GUI must be 1)? [0,1]
USE_HTML ?= 1
# Build multimedia library (USE_GUI must be 1)? [0,1]
USE_MEDIA ?= 1
# Build wxXRC library (USE_GUI must be 1)? [0,1]
USE_XRC ?= 1
# Build wxAUI library (USE_GUI must be 1)? [0,1]
USE_AUI ?= 1
# Build wxRichTextCtrl library (USE_GUI must be 1)? [0,1]
USE_RICHTEXT ?= 1
# Build OpenGL canvas library (USE_GUI must be 1)? [0,1]
USE_OPENGL ?= 0
# Build ODBC database classes (USE_GUI must be 1)? [0,1]
USE_ODBC ?= 0
# Build quality assurance classes library (USE_GUI must be 1)? [0,1]
USE_QA ?= 0
# Enable exceptions in compiled code. [0,1]
USE_EXCEPTIONS ?= 1
# Enable run-time type information (RTTI) in compiled code. [0,1]
USE_RTTI ?= 1
# Enable threading in compiled code. [0,1]
USE_THREADS ?= 1
# Enable wxCairoContext for platforms other than Linux/GTK. [0,1]
USE_CAIRO ?= 0
# Link with gdiplus.lib? (Needed for wxGraphicsContext, will also set wxUSE_GRAPHICS_CONTEXT) [0,1]
USE_GDIPLUS ?= 0
# Is this official build by wxWidgets developers? [0,1]
OFFICIAL_BUILD ?= 0
# Use this to name your customized DLLs differently
VENDOR ?= custom
#
WX_FLAVOUR ?=
#
WX_LIB_FLAVOUR ?=
# Name of your custom configuration. This affects directory
# where object files are stored as well as the location of
# compiled .lib files and setup.h under the lib/ toplevel directory.
CFG ?=
# Compiler flags needed to compile test suite in tests directory. If you want
# to run the tests, set it so that the compiler can find CppUnit headers.
CPPUNIT_CFLAGS ?=
# Linker flags needed to link test suite in tests directory. If you want
# to run the tests, include CppUnit library here.
CPPUNIT_LIBS ?=
# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= static
# Set the version of your Mingw installation here.
# "3" ...... this is for Mingw 2.0 or newer (comes with gcc3)
# "2.95" ... for Mingw 1.1 or any of the older versions [3,2.95]
GCC_VERSION ?= 3
//-----------------------------------------------------------------------------
6) Opened a cli in Windows, and navigated to "c:\wxWidgets-2.8.12\build\msw", then issued the following command in the cli: "mingw32-make -f makefile.gcc clean"
7) Once the cleaning operation was completed, I then issued: "mingw32-make -f makefile.gcc"
8 The build proceeded without errors. I ended up with a "gcc_lib" subdirectory with the following files in it:
//-----------------------------------------------------------------
c:\wxWidgets-2.8.12\lib\gcc_lib>dir
Volume in drive C is CB
Volume Serial Number is 04FF-04B1
Directory of c:\wxWidgets-2.8.12\lib\gcc_lib
08/07/2014 03:03 PM <DIR> .
08/07/2014 03:03 PM <DIR> ..
08/07/2014 02:56 PM 197,168 libwxexpat.a
08/07/2014 02:55 PM 142,960 libwxjpeg.a
08/07/2014 03:03 PM 17,579,396 libwxmsw28.a
08/07/2014 02:55 PM 166,664 libwxpng.a
08/07/2014 02:55 PM 74,928 libwxregex.a
08/07/2014 02:56 PM 328,452 libwxtiff.a
08/07/2014 02:55 PM 73,190 libwxzlib.a
08/07/2014 03:03 PM <DIR> msw
7 File(s) 18,562,758 bytes
3 Dir(s) 30,449,082,368 bytes free
c:\wxWidgets-2.8.12\lib\gcc_lib>
8a. The build.cfg file that the compilation process generated is:
WXVER_MAJOR=2
WXVER_MINOR=8
WXVER_RELEASE=12
BUILD=release
MONOLITHIC=1
SHARED=0
UNICODE=0
WXUNIV=0
CFG=
VENDOR=custom
OFFICIAL_BUILD=0
DEBUG_FLAG=default
DEBUG_INFO=default
RUNTIME_LIBS=static
MSLU=0
USE_EXCEPTIONS=1
USE_THREADS=1
USE_GUI=1
USE_HTML=1
USE_MEDIA=1
USE_ODBC=0
USE_OPENGL=0
USE_QA=0
USE_GDIPLUS=0
COMPILER=gcc
CC=gcc
CXX=g++
CFLAGS=
CPPFLAGS=
CXXFLAGS=-fno-keep-inline-dllexport
LDFLAGS=
//--------------------------------------------------------------------
9) I opened my project, cleaned the workspace, rebuilt the workspace, and ended up with this error: "C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_app.o):app.cpp|| undefined reference to `InitCommonControls@0'|" and others like it.
10) In the global compiler settings I have included all the libraries listed above in::
"Settings->Compiler->Linker Settings->Link libraries" And in the "Other linker options" I have "-static" (minus the quotations).
11) The full build log is included here:
||=== Build: Debug in BicycleGearingCalculator (compiler: GNU GCC Compiler) ===|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_app.o):app.cpp|| undefined reference to `InitCommonControls@0'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_app.o):app.cpp|| undefined reference to `OleInitialize@4'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_app.o):app.cpp|| undefined reference to `OleUninitialize@0'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_msw_spinbutt.o):spinbutt.cpp|| undefined reference to `CreateUpDownControl@48'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_filename.o):filename.cpp|| undefined reference to `CoCreateInstance@20'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_filename.o):filename.cpp|| undefined reference to `IID_IPersistFile'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_resync_to_restart'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_std_error'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_destroy_decompress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_CreateDecompress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_read_header'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_start_decompress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_read_scanlines'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_finish_decompress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_destroy_decompress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_finish_decompress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_destroy_decompress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_std_error'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_destroy_compress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_CreateCompress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_set_defaults'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_set_quality'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_start_compress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_write_scanlines'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_finish_compress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imagjpeg.o):imagjpeg.cpp|| undefined reference to `jpeg_destroy_compress'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_droptgt.o):droptgt.cpp|| undefined reference to `CoLockObjectExternal@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_droptgt.o):droptgt.cpp|| undefined reference to `RegisterDragDrop@8'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_droptgt.o):droptgt.cpp|| undefined reference to `CoLockObjectExternal@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_droptgt.o):droptgt.cpp|| undefined reference to `RevokeDragDrop@4'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_droptgt.o):droptgt.cpp|| undefined reference to `CoLockObjectExternal@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_droptgt.o):droptgt.cpp:(.data+0x0)||undefined reference to `IID_IUnknown'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_droptgt.o):droptgt.cpp:(.data+0x4)||undefined reference to `IID_IDropTarget'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_msw_listctrl.o):listctrl.cpp|| undefined reference to `ImageList_GetImageCount@4'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_msw_listctrl.o):listctrl.cpp|| undefined reference to `ImageList_Draw@24'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_msw_listctrl.o):listctrl.cpp|| undefined reference to `ImageList_GetIconSize@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_statbr95.o):statbr95.cpp|| undefined reference to `CreateStatusWindowA@16'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_Destroy@4'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_Create@20'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_GetImageCount@4'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_GetIconSize@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_Add@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_AddMasked@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_ReplaceIcon@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_Replace@16'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_ReplaceIcon@12'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_Remove@8'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_SetBkColor@8'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_Draw@24'|
C:\wxWidgets-2.8.12\lib\gcc_lib\libwxmsw28.a(monolib_imaglist.o):imaglist.cpp|| undefined reference to `ImageList_GetIcon@12'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|
Can anyone help with what is going wrong that I cannot generate a statically linked exe?
To be clear...if I generate a shared library, then put the resulting "...custom.dll" in the folders for debug and release...I get a good compile without errors, and a perfectly working application. The issue is that I need to compile this thing statically to meet the criteria I have been given...
I am appreciative for any help,
Sincerely and respectfully,
Dave