How do I Compile wxWidgets Sample Code? Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
User avatar
ColleenKobe
Earned some good credits
Earned some good credits
Posts: 109
Joined: Mon Aug 31, 2015 3:47 pm

How do I Compile wxWidgets Sample Code?

Post by ColleenKobe »

How do I compile and run the sample code that comes with wxWidgets?

I would like to compile and run one of the sample programs that came with wxWidgets. The code is in C:\wxWidgets\samples\dataview. The files in that directory are:

Code: Select all

c: dataview       .bkl         420   4/14/17   9:46   \wxWidgets\samples\dataview
c: dataview       .cpp       43022   4/14/17   9:46   \wxWidgets\samples\dataview
c: dataview_vc7   .vcproj    11150   4/14/17   9:46   \wxWidgets\samples\dataview
c: dataview_vc8   .vcproj    26269   4/14/17   9:46   \wxWidgets\samples\dataview
c: dataview_vc9   .vcproj    25657   4/14/17   9:46   \wxWidgets\samples\dataview
c: descrip        .mms        2151   4/14/17   9:46   \wxWidgets\samples\dataview
c: makefile       .bcc        7714   4/14/17   9:46   \wxWidgets\samples\dataview
c: makefile       .gcc        7108   4/14/17   9:46   \wxWidgets\samples\dataview
c: Makefile       .in         9274   4/14/17   9:46   \wxWidgets\samples\dataview
c: makefile       .unx        2883   4/14/17   9:46   \wxWidgets\samples\dataview
c: makefile       .vc        11504   4/14/17   9:46   \wxWidgets\samples\dataview
c: mymodels       .cpp       15923   4/14/17   9:46   \wxWidgets\samples\dataview
c: mymodels       .h          7914   4/14/17   9:46   \wxWidgets\samples\dataview
c: null           .xpm         548   4/14/17   9:46   \wxWidgets\samples\dataview
c: wx_small       .xpm         523   4/14/17   9:46   \wxWidgets\samples\dataview
I am using the following programming environment:

Code: Select all

Software Versions
-------- --------
CodeLite    10.0.6
gcc          4.9.3
tdm-gcc      5.1.0.2
Windows 10  Pro, 64-bit
wxWidgets    3.1.0
wxCrafter    2.6

Target platform   32-bit Windows
Target build   debug
Today, to try to find out how to compile the sample code, I went to the wxWidgets forum and searched for "sample code" (search.php?keywords=sample+code) But both "sample" and "code" were ignored because they were too common. Not sure what other search terms would work for this issue.

When I first started with wxWidgets, I tried for two days to get one of the sample code programs to compile. But since I was using CodeLite and wxCrafter, I did not understand what files I needed. Aren't some of those files for Unix, or Visual Studios? What files did I need, and which ones could I ignore? If I need them, what do I do with them? I was clueless. In the end, I gave up.

But now I'm back because I'm at a point where I really have to see how wxWidgets code is intended to be put together.

Thank you for your help with this newbie question.

Colleen
User avatar
xaviou
Super wx Problem Solver
Super wx Problem Solver
Posts: 437
Joined: Mon Aug 21, 2006 3:18 pm
Location: Annecy - France
Contact:

Re: How do I Compile wxWidgets Sample Code?

Post by xaviou »

Hi.

If your compiler (gcc) can be found from the path, you can just open a command prompt, change the working directory to the corresponding sample folder, and run "mingw32-make.exe -f makefile.gcc".

If you want to use CodeLite, you can create a new project in the sample directory and add the ".cpp" and ".h" files : this should work.

Regards
Xav'
My wxWidgets stuff web page : X@v's wxStuff
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How do I Compile wxWidgets Sample Code?

Post by ONEEYEMAN »

Hi,
In addition to what Xaviou said:

Check what command you used to compile wxWidgets.
Then change the directory to c:\wxWidgets/samples/dataview and issue exactly the same command you used to compile the library itself.

Also, for that I wouldn't bother with CodeLite. Just compile and run from the Terminal. And then if you want to check the source - you can open the cpp file inside CodeLite and follow the execution path.

Thank you.
User avatar
ColleenKobe
Earned some good credits
Earned some good credits
Posts: 109
Joined: Mon Aug 31, 2015 3:47 pm

Re: How do I Compile wxWidgets Sample Code?

Post by ColleenKobe »

Thank you for your quick response! I decided to try your command line suggestions. I got three errors. Perhaps you can see what I'm doing wrong.

Here is my path (broken up here for legibility). wxWidgets is installed in C:\wxWidgets. MinGW is installed in C:\MinGW.

Code: Select all

Path=C:\WINDOWS;
C:\WINDOWS\system32\;
C:\WINDOWS\System32\Wbem\;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\Windows\system32\config\systemprofile\.dnx\bin\;
C:\ProgramData\Oracle\Java\javapath\;
C:\Program Files (x86)\Intel\iCLS Client\;
C:\Program Files\Intel\iCLS Client\;
C:\Program Files\Intel\WiFi\bin\;
C:\Program Files\Common Files\Intel\WirelessCommon\;
C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static\;
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86\;
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64\;
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\;
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\;
C:\Program Files\Microsoft DNX\Dnvm\;
C:\Program Files (x86)\KEDITW\;
C:\Program Files (x86)\KEDITW\User\;
C:\MinGW\bin\;
C:\wxWidgets\bin\;
C:\TDM-GCC-32\bin\;
C:\MinGW\;
C:\MinGW\include\;
C:\MinGW\mingw32\include\;
C:\wxWidgets\;
C:\wxWidgets\build\msw\gcc_mswu\;
C:\wxWidgets\include\;
C:\wxWidgets\lib\gcc_dll\;
F:\;
F:\util\;
c:\windows\system32;
C:\WINDOWS\system32;
C:\WINDOWS\System32\Wbem;
C:\Users\Colleen\AppData\Local\Microsoft\WindowsApps;
And here is makefile.gcc.

Code: Select all

# =========================================================================
#     This makefile was generated by
#     Bakefile 0.2.9 (http://www.bakefile.org)
#     Do not modify, all changes will be overwritten!
# =========================================================================

include ../../build/msw/config.gcc

# -------------------------------------------------------------------------
# Do not modify the rest of this file!
# -------------------------------------------------------------------------

### Variables: ###

CPPDEPS = -MT$@ [email protected] -MD -MP
WX_RELEASE_NODOT = 31
COMPILER_PREFIX = gcc
OBJS = \
	$(COMPILER_PREFIX)$(COMPILER_VERSION)_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
LIBDIRNAME = \
	.\..\..\lib\$(COMPILER_PREFIX)$(COMPILER_VERSION)_$(LIBTYPE_SUFFIX)$(CFG)
SETUPHDIR = \
	$(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)
DATAVIEW_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) $(__THREADSFLAG) \
	$(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \
	$(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) \
	$(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) \
	-I$(SETUPHDIR) -I.\..\..\include $(____CAIRO_INCLUDEDIR_FILENAMES_p) -W \
	-Wall -I. $(__DLLFLAG_p) -I.\..\..\samples -DNOPCH $(__RTTIFLAG_5) \
	$(__EXCEPTIONSFLAG_6) -Wno-ctor-dtor-privacy $(CPPFLAGS) $(CXXFLAGS)
DATAVIEW_OBJECTS =  \
	$(OBJS)\dataview_dataview.o \
	$(OBJS)\dataview_mymodels.o \
	$(OBJS)\dataview_sample_rc.o

### Conditionally set variables: ###

ifeq ($(GCC_VERSION),2.95)
GCCFLAGS = -fvtable-thunks
endif
ifeq ($(USE_GUI),0)
PORTNAME = base
endif
ifeq ($(USE_GUI),1)
PORTNAME = msw$(TOOLKIT_VERSION)
endif
ifeq ($(OFFICIAL_BUILD),1)
COMPILER_VERSION = ERROR-COMPILER-VERSION-MUST-BE-SET-FOR-OFFICIAL-BUILD
endif
ifeq ($(BUILD),debug)
WXDEBUGFLAG = d
endif
ifeq ($(UNICODE),1)
WXUNICODEFLAG = u
endif
ifeq ($(WXUNIV),1)
WXUNIVNAME = univ
endif
ifeq ($(SHARED),1)
WXDLLFLAG = dll
endif
ifeq ($(SHARED),0)
LIBTYPE_SUFFIX = lib
endif
ifeq ($(SHARED),1)
LIBTYPE_SUFFIX = dll
endif
ifeq ($(MONOLITHIC),0)
EXTRALIBS_FOR_BASE =
endif
ifeq ($(MONOLITHIC),1)
EXTRALIBS_FOR_BASE =
endif
ifeq ($(BUILD),debug)
__OPTIMIZEFLAG_2 = -O0
endif
ifeq ($(BUILD),release)
__OPTIMIZEFLAG_2 = -O2
endif
ifeq ($(USE_RTTI),0)
__RTTIFLAG_5 = -fno-rtti
endif
ifeq ($(USE_RTTI),1)
__RTTIFLAG_5 =
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONSFLAG_6 = -fno-exceptions
endif
ifeq ($(USE_EXCEPTIONS),1)
__EXCEPTIONSFLAG_6 =
endif
ifeq ($(WXUNIV),1)
__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
endif
ifeq ($(WXUNIV),1)
__WXUNIV_DEFINE_p_1 = --define __WXUNIVERSAL__
endif
ifeq ($(DEBUG_FLAG),0)
__DEBUG_DEFINE_p = -DwxDEBUG_LEVEL=0
endif
ifeq ($(DEBUG_FLAG),0)
__DEBUG_DEFINE_p_1 = --define wxDEBUG_LEVEL=0
endif
ifeq ($(BUILD),release)
__NDEBUG_DEFINE_p = -DNDEBUG
endif
ifeq ($(BUILD),release)
__NDEBUG_DEFINE_p_1 = --define NDEBUG
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONS_DEFINE_p = -DwxNO_EXCEPTIONS
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONS_DEFINE_p_1 = --define wxNO_EXCEPTIONS
endif
ifeq ($(USE_RTTI),0)
__RTTI_DEFINE_p = -DwxNO_RTTI
endif
ifeq ($(USE_RTTI),0)
__RTTI_DEFINE_p_1 = --define wxNO_RTTI
endif
ifeq ($(USE_THREADS),0)
__THREAD_DEFINE_p = -DwxNO_THREADS
endif
ifeq ($(USE_THREADS),0)
__THREAD_DEFINE_p_1 = --define wxNO_THREADS
endif
ifeq ($(UNICODE),0)
__UNICODE_DEFINE_p = -DwxUSE_UNICODE=0
endif
ifeq ($(UNICODE),1)
__UNICODE_DEFINE_p = -D_UNICODE
endif
ifeq ($(UNICODE),0)
__UNICODE_DEFINE_p_1 = --define wxUSE_UNICODE=0
endif
ifeq ($(UNICODE),1)
__UNICODE_DEFINE_p_1 = --define _UNICODE
endif
ifeq ($(USE_CAIRO),1)
____CAIRO_INCLUDEDIR_FILENAMES_p = -I$(CAIRO_ROOT)\include\cairo
endif
ifeq ($(USE_CAIRO),1)
__CAIRO_INCLUDEDIR_p = --include-dir $(CAIRO_ROOT)/include/cairo
endif
ifeq ($(SHARED),1)
__DLLFLAG_p = -DWXUSINGDLL
endif
ifeq ($(SHARED),1)
__DLLFLAG_p_1 = --define WXUSINGDLL
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_ADV_p = \
	-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_CORE_p = \
	-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_BASE_p = \
	-lwxbase$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)
endif
ifeq ($(MONOLITHIC),1)
__WXLIB_MONO_p = \
	-lwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)
endif
ifeq ($(MONOLITHIC),1)
ifeq ($(USE_STC),1)
__LIB_SCINTILLA_IF_MONO_p = -lwxscintilla$(WXDEBUGFLAG)
endif
endif
ifeq ($(USE_GUI),1)
__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG)
endif
ifeq ($(USE_CAIRO),1)
__CAIRO_LIB_p = -lcairo
endif
ifeq ($(USE_CAIRO),1)
____CAIRO_LIBDIR_FILENAMES_p = -L$(CAIRO_ROOT)\lib
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO = -g
endif
endif
ifeq ($(BUILD),release)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO =
endif
endif
ifeq ($(DEBUG_INFO),0)
__DEBUGINFO =
endif
ifeq ($(DEBUG_INFO),1)
__DEBUGINFO = -g
endif
ifeq ($(USE_THREADS),0)
__THREADSFLAG =
endif
ifeq ($(USE_THREADS),1)
__THREADSFLAG = -mthreads
endif


all: $(OBJS)
$(OBJS):
	-if not exist $(OBJS) mkdir $(OBJS)

### Targets: ###

all: $(OBJS)\dataview.exe

clean:
	-if exist $(OBJS)\*.o del $(OBJS)\*.o
	-if exist $(OBJS)\*.d del $(OBJS)\*.d
	-if exist $(OBJS)\dataview.exe del $(OBJS)\dataview.exe

$(OBJS)\dataview.exe: $(DATAVIEW_OBJECTS) $(OBJS)\dataview_sample_rc.o
	$(CXX) -o $@ $(DATAVIEW_OBJECTS)  $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows $(____CAIRO_LIBDIR_FILENAMES_p) $(LDFLAGS)  $(__WXLIB_ADV_p)  $(__WXLIB_CORE_p)  $(__WXLIB_BASE_p)  $(__WXLIB_MONO_p) $(__LIB_SCINTILLA_IF_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p)   -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__CAIRO_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet

$(OBJS)\dataview_dataview.o: ./dataview.cpp
	$(CXX) -c -o $@ $(DATAVIEW_CXXFLAGS) $(CPPDEPS) $<

$(OBJS)\dataview_mymodels.o: ./mymodels.cpp
	$(CXX) -c -o $@ $(DATAVIEW_CXXFLAGS) $(CPPDEPS) $<

$(OBJS)\dataview_sample_rc.o: ./../sample.rc
	$(WINDRES) -i$< -o$@    --define __WXMSW__ $(__WXUNIV_DEFINE_p_1) $(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) $(__UNICODE_DEFINE_p_1) --include-dir $(SETUPHDIR) --include-dir ./../../include $(__CAIRO_INCLUDEDIR_p) --include-dir . $(__DLLFLAG_p_1) --include-dir ./../../samples --define NOPCH

.PHONY: all clean


SHELL := $(COMSPEC)

# Dependencies tracking:
-include $(OBJS)/*.d
Here is what happened when I tried to compile and link and run from the command line, using the commands you gave me:

Code: Select all

U:\>c:

C:\>cd wxwidgets

C:\wxWidgets>cd samples

C:\wxWidgets\samples>cd dataview

C:\wxWidgets\samples\dataview>mingw32-make.exe -f makefile.gcc
if not exist gcc_mswud mkdir gcc_mswud
g++ -c -o gcc_mswud\dataview_dataview.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXMSW__       -D_UNICODE -I.\..\..\lib\gcc_lib\mswud -I.\..\..\include  -W -Wall -I.  -I.\..\..\samples -DNOPCH   -Wno-ctor-dtor-privacy   -MTgcc_mswud\dataview_dataview.o -MFgcc_mswud\dataview_dataview.o.d -MD -MP dataview.cpp
g++ -c -o gcc_mswud\dataview_mymodels.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXMSW__       -D_UNICODE -I.\..\..\lib\gcc_lib\mswud -I.\..\..\include  -W -Wall -I.  -I.\..\..\samples -DNOPCH   -Wno-ctor-dtor-privacy   -MTgcc_mswud\dataview_mymodels.o -MFgcc_mswud\dataview_mymodels.o.d -MD -MP mymodels.cpp
windres --use-temp-file -i../sample.rc -ogcc_mswud\dataview_sample_rc.o    --define __WXMSW__       --define _UNICODE --include-dir .\..\..\lib\gcc_lib\mswud --include-dir ./../../include  --include-dir .  --include-dir ./../../samples --define NOPCH
g++ -o gcc_mswud\dataview.exe gcc_mswud\dataview_dataview.o gcc_mswud\dataview_mymodels.o gcc_mswud\dataview_sample_rc.o  -g -mthreads -L.\..\..\lib\gcc_lib -Wl,--subsystem,windows -mwindows    -lwxmsw31ud_adv  -lwxmsw31ud_core  -lwxbase31ud    -lwxtiffd -lwxjpegd -lwxpngd   -lwxzlibd -lwxregexud -lwxexpatd   -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet
c:/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw31ud_adv
c:/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw31ud_core
c:/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/ld.exe: cannot find -lwxbase31ud
collect2.exe: error: ld returned 1 exit status
makefile.gcc:226: recipe for target 'gcc_mswud\dataview.exe' failed
mingw32-make.exe: *** [gcc_mswud\dataview.exe] Error 1

C:\wxWidgets\samples\dataview>

I searched for wxmsw3lud_adv*.* on my C: drive, but it's not there. Then I googled "wxmsw3lud_adv" (without the quotes) and got ZERO hits (how often does THAT happen?!).

Suggestions? Do I really need those missing files?

Colleen
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4183
Joined: Sun Jan 03, 2010 5:45 pm

Re: How do I Compile wxWidgets Sample Code?

Post by PB »

For starters:

FIrst, the missing libraries do not have 3l in their name, it is 31 (for wxWidgets version 3.1).

Second, do you have those three missing libraries, i.e.,

Code: Select all

libwxmsw31u_adv.a
libwxmsw31ud_core.a
libwxbase31ud.a
in your c:\wxWidgets\lib\gcc_lib?

Those three files are wxWidgets libraries for static multilib debug configuration (the default configuration for makefiles on MSW), the two last ones are the most basic ones, see here for more information. If you really did not know that, I would recommend to familiarize yourself with basic wxWidgets stuff, starting with reading WXWIN\docs\msw\install.txt file.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How do I Compile wxWidgets Sample Code?

Post by ONEEYEMAN »

Hi, Colleen,
Did you compile wxWidgets in Debug or Release mode?
Like I said - in order to compile the sample{s} you have to enter the same command you used to compile the library itself.

Thank you.
User avatar
ColleenKobe
Earned some good credits
Earned some good credits
Posts: 109
Joined: Mon Aug 31, 2015 3:47 pm

Re: How do I Compile wxWidgets Sample Code?

Post by ColleenKobe »

Thanks for replying so quickly.

Yes, I mistook a lower-case L ("l") for a one ("1").

No, I do not have the following files anywhere on my computer:

Code: Select all

libwxmsw31u_adv.a
libwxmsw31ud_core.a
libwxbase31ud.a
In my C:\wxWidgets\lib\gcc_lib, I have the following files:

Code: Select all

c: libwxexpat        .a             227352   4/14/17  16:09   \wxWidgets\lib\gcc_lib
c: libwxexpatd       .a             388386   4/14/17  15:40   \wxWidgets\lib\gcc_lib
c: libwxjpeg         .a             181584   4/14/17  16:08   \wxWidgets\lib\gcc_lib
c: libwxjpegd        .a             805750   4/14/17  15:40   \wxWidgets\lib\gcc_lib
c: libwxmsw31u       .a           65193456   4/14/17  16:38   \wxWidgets\lib\gcc_lib
c: libwxmsw31u_gl    .a             317958   4/14/17  16:39   \wxWidgets\lib\gcc_lib
c: libwxmsw31ud      .a          337822240   4/14/17  16:07   \wxWidgets\lib\gcc_lib
c: libwxmsw31ud_gl   .a            1358328   4/14/17  16:07   \wxWidgets\lib\gcc_lib
c: libwxpng          .a             256542   4/14/17  16:08   \wxWidgets\lib\gcc_lib
c: libwxpngd         .a             662056   4/14/17  15:40   \wxWidgets\lib\gcc_lib
c: libwxregexu       .a              91578   4/14/17  16:08   \wxWidgets\lib\gcc_lib
c: libwxregexud      .a             177182   4/14/17  15:40   \wxWidgets\lib\gcc_lib
c: libwxscintilla    .a            3367898   4/14/17  16:11   \wxWidgets\lib\gcc_lib
c: libwxscintillad   .a           21046240   4/14/17  15:41   \wxWidgets\lib\gcc_lib
c: libwxtiff         .a             490140   4/14/17  16:09   \wxWidgets\lib\gcc_lib
c: libwxtiffd        .a            1120858   4/14/17  15:40   \wxWidgets\lib\gcc_lib
c: libwxzlib         .a              97494   4/14/17  16:08   \wxWidgets\lib\gcc_lib
c: libwxzlibd        .a             209516   4/14/17  15:40   \wxWidgets\lib\gcc_lib
c: mswu                          <dir>       4/11/17  12:41   \wxWidgets\lib\gcc_lib
c: mswud                         <dir>       4/11/17  12:13   \wxWidgets\lib\gcc_lib

This is the batch file I used to compile my library:

Code: Select all

C:
cd %WXWIN%\build\msw

rem mingw32-make -f makefile.gcc setup_h
rem mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=0 BUILD=release setup_h
rem
rem mingw32-make -f Makefile.gcc SHARED=1 BUILD=release VENDOR=cl CXXFLAGS="-fno-keep-inline-dllexport -std=c++11" MONOLITHIC=0 clean
rem mingw32-make -f Makefile.gcc SHARED=1 BUILD=release VENDOR=cl CXXFLAGS="-fno-keep-inline-dllexport -std=c++11" MONOLITHIC=0

rem ----------------------------------------------------------------------------
rem 2017-04-11:  "doublemax" on the wxWidgets online forum recommended using the
rem following two lines to compile the wxWidgets libraries.  So I commented out
rem the four lines above, and am trying this way.
rem ----------------------------------------------------------------------------

mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=debug
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=release
So, then, using the above debug line as an example, I copied the following lines into a new file called C:\wxWidgets\samples\dataview\compile.bat:

Code: Select all

set CodeLiteDir=C:\CodeLite
set WXCFG=gcc_dll\mswud
set WXWIN=C:\wxWidgets

mingw32-make.exe -f makefile.gcc SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=debug
Then I ran compile.bat. I terminated the execution very quickly. This was my output:

Code: Select all

C:\wxWidgets\samples\dataview>compile

C:\wxWidgets\samples\dataview>set CodeLiteDir=C:\CodeLite

C:\wxWidgets\samples\dataview>set WXCFG=gcc_dll\mswud

C:\wxWidgets\samples\dataview>set WXWIN=C:\wxWidgets

C:\wxWidgets\samples\dataview>mingw32-make.exe -f makefile.gcc SHARED=0 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=debug
g++ -o gcc_mswud\dataview.exe gcc_mswud\dataview_dataview.o gcc_mswud\dataview_mymodels.o gcc_mswud\dataview_sample_rc.o  -g -mthreads -L.\..\..\lib\gcc_lib -Wl,--subsystem,windows -mwindows          -lwxmsw31ud -lwxscintillad -lwxtiffd -lwxjpegd -lwxpngd   -lwxzlibd -lwxregexud -lwxexpatd   -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet
gcc_mswud\dataview_dataview.o: In function `WinMain@16':
C:\wxWidgets\samples\dataview/dataview.cpp:269: undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'
gcc_mswud\dataview_dataview.o: In function `Z11wxCreateAppv':
C:\wxWidgets\samples\dataview/dataview.cpp:269: undefined reference to `wxAppConsoleBase::CheckBuildOptions(char const*, char const*)'
gcc_mswud\dataview_dataview.o: In function `ZN5MyApp6OnInitEv':
C:\wxWidgets\samples\dataview/dataview.cpp:273: undefined reference to `wxAppConsoleBase::OnInit()'
gcc_mswud\dataview_dataview.o: In function `ZN7MyFrameC2EP7wxFrameRK8wxStringiiii':
C:\wxWidgets\samples\dataview/dataview.cpp:407: undefined reference to `wxFrameNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:417: undefined reference to `wxIcon::wxIcon(wxString const&, wxBitmapType, int, int)'
C:\wxWidgets\samples\dataview/dataview.cpp:417: undefined reference to `wxTopLevelWindowBase::SetIcon(wxIcon const&)'
C:\wxWidgets\samples\dataview/dataview.cpp:417: undefined reference to `wxIcon::~wxIcon()'
C:\wxWidgets\samples\dataview/dataview.cpp:425: undefined reference to `wxEmptyString'
C:\wxWidgets\samples\dataview/dataview.cpp:426: undefined reference to `wxEmptyString'
C:\wxWidgets\samples\dataview/dataview.cpp:427: undefined reference to `wxEmptyString'
C:\wxWidgets\samples\dataview/dataview.cpp:428: undefined reference to `wxEmptyString'
C:\wxWidgets\samples\dataview/dataview.cpp:431: undefined reference to `wxEmptyString'
gcc_mswud\dataview_dataview.o:C:\wxWidgets\samples\dataview/dataview.cpp:432: more undefined references to `wxEmptyString' follow
gcc_mswud\dataview_dataview.o: In function `ZN7MyFrameC2EP7wxFrameRK8wxStringiiii':
C:\wxWidgets\samples\dataview/dataview.cpp:443: undefined reference to `wxMenuBar::wxMenuBar()'
C:\wxWidgets\samples\dataview/dataview.cpp:447: undefined reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
C:\wxWidgets\samples\dataview/dataview.cpp:448: undefined reference to `wxStatusLineNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:448: undefined reference to `wxFrameBase::CreateStatusBar(int, long, int, wxString const&)'
C:\wxWidgets\samples\dataview/dataview.cpp:453: undefined reference to `wxTextCtrlNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:453: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:453: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:453: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:455: undefined reference to `wxLogTextCtrl::wxLogTextCtrl(wxTextCtrl*)'
C:\wxWidgets\samples\dataview/dataview.cpp:455: undefined reference to `wxLog::SetActiveTarget(wxLog*)'
C:\wxWidgets\samples\dataview/dataview.cpp:456: undefined reference to `wxLOG_COMPONENT'
C:\wxWidgets\samples\dataview/dataview.cpp:456: undefined reference to `wxLOG_COMPONENT'
C:\wxWidgets\samples\dataview/dataview.cpp:462: undefined reference to `wxNotebookNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:462: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:462: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:462: undefined reference to `wxNotebook::wxNotebook(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
C:\wxWidgets\samples\dataview/dataview.cpp:464: undefined reference to `wxPanelNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:464: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:464: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:471: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:471: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:471: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:471: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:472: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:472: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:472: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:472: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:473: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:473: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:473: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:473: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:474: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:474: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:474: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:474: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:475: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:475: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:475: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:475: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:476: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:476: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:476: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:476: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:480: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:480: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:480: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:480: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:482: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:482: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:482: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:482: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:489: undefined reference to `wxStaticTextNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:488: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:488: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:492: undefined reference to `wxWindowBase::SetSizerAndFit(wxSizer*, bool)'
C:\wxWidgets\samples\dataview/dataview.cpp:498: undefined reference to `wxPanelNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:498: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:498: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:503: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:503: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:503: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:503: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:504: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:504: undefined reference to `wxDefaultValidator'
C:\wxWidgets\samples\dataview/dataview.cpp:504: undefined reference to `wxDefaultSize'
C:\wxWidgets\samples\dataview/dataview.cpp:504: undefined reference to `wxDefaultPosition'
C:\wxWidgets\samples\dataview/dataview.cpp:505: undefined reference to `wxButtonNameStr'
C:\wxWidgets\samples\dataview/dataview.cpp:505: undefined reference to `wxDefaultValidatormakefile.gcc:226: recipe for target 'gcc_mswud\dataview.exe' failed
mingw32-make.exe: *** [gcc_mswud\dataview.exe] Error 3
Terminate batch job (Y/N)? y

C:\wxWidgets\samples\dataview>
I'm guessing I'm missing a directory in my path. Any idea what it would be?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How do I Compile wxWidgets Sample Code?

Post by ONEEYEMAN »

Hi, Colleen,
You trouble stems from the fact that you compiled the library as "monolithic" one.
I don't know why the sample does not want to compile - my guess is: very few people are actually trying to comnpile a monolithic one and the build bot that is set up to trac problems during wx development also does not use this option.

As a test only - unpack wxWidgets in the new directory (lets say c:\temp), go to temp/wxWidgets/build/msw and issue the following command:

Code: Select all


mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=0 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=debug
then go to the samples/dataview directory and do it again.

The difference would be that "MONOLITHIC" build generates one huge dll/so/dylib while "NON-MONOLITHIC" generates multiple nicely spread libraries.

I would also file a bug at trac.wxwidgets.org explaining that after doing monolithic build the sample wouldn't compile with makefile.gcc as they are produced to make a non-monolithic build. But that's would be up to you.

Thank you.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4183
Joined: Sun Jan 03, 2010 5:45 pm

Re: How do I Compile wxWidgets Sample Code?

Post by PB »

ONEEYEMAN, while it may be unusual to use STATIC monolithic build, based on the posts above, the command line for building sample with MONOLITHIC=1 looks as it is properly looking for monolithic build, see the list of libraries to link with.

The original (without MONOLITHIC)
g++ -o gcc_mswud\dataview.exe gcc_mswud\dataview_dataview.o gcc_mswud\dataview_mymodels.o gcc_mswud\dataview_sample_rc.o -g -mthreads -L.\..\..\lib\gcc_lib -Wl,--subsystem,windows -mwindows -lwxmsw31ud_adv -lwxmsw31ud_core -lwxbase31ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet

MONOLITHIC=1
g++ -o gcc_mswud\dataview.exe gcc_mswud\dataview_dataview.o gcc_mswud\dataview_mymodels.o gcc_mswud\dataview_sample_rc.o -g -mthreads -L.\..\..\lib\gcc_lib -Wl,--subsystem,windows -mwindows -lwxmsw31ud -lwxscintillad -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet
The issue why the sample builds now is elsewhere, my guess is there are mixed files either in the sample build or the library build. Obvisously, the OP did not heed my advice to learn about wxWidgets builds and sets WXCFG to wrong value for the build used, but I do not even know if this variable is used by wxWidgets makefiles at all.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7449
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How do I Compile wxWidgets Sample Code?

Post by ONEEYEMAN »

PB,
I did say to type in the compile command. ;-)
Nevertheless, building MONOLITHIC is not recommended I think.

Thank you.
Manolo
Can't get richer than this
Can't get richer than this
Posts: 827
Joined: Mon Apr 30, 2012 11:07 pm

Re: How do I Compile wxWidgets Sample Code?

Post by Manolo »

I see these entries in your PATH:
C:\MinGW\bin\;
C:\wxWidgets\bin\;
C:\TDM-GCC-32\bin\;
While they (mingw, tdm-gcc-32) may not conflict (despite of both provide mingw32-make.exe and rest of files) that fact suggests me that you have compiled wx with one compiler and now you are trying to compile a sample (or your app) with the other compiler. This is a source of problems, the easiest that some libs are not found.

Mingw and TDM share the common GCC origin. But different versions and other matters make them incompatible, specially for static builds.

By the way, why do you need C:\wxWidgets\bin\; in the PATH?
User avatar
ColleenKobe
Earned some good credits
Earned some good credits
Posts: 109
Joined: Mon Aug 31, 2015 3:47 pm

Re: How do I Compile wxWidgets Sample Code?

Post by ColleenKobe »

Manolo wrote: Mingw and TDM share the common GCC origin. But different versions and other matters make them incompatible, specially for static builds.
Thank your for that illuminating information!

Here is the short answer to your questions about the entries in my path and the environment variables.

I started writing this program using NetBeans, MinGW, and C. All three environments were new to me. I worked with them for about six months. Then my project engineer told me to change everything over to Visual Studios. VS was new to me. I changed over and worked with VS for about six months. Then he told me to change to CodeLite, wxWidgets, wxCrafter, and MinGW. Those four were also new to me.

So in answer to your questions about the entries in my path, and about the environment variables: I don't remember at what point it became necessary to have them there. As I said at the top of this listing, I never did get the wxWidgets sample code to compile.

I do not care what my path is, or what my environment variables are. I am happy to change whatever I need to change in order to successfully compile the original wxWidgets code, and the sample code.

But I do need to be able to return to CodeLite when I'm done with this command-line build-making.

I removed from my path:

Code: Select all

C:\TDM-GCC-32\bin\;
C:\MinGW\;
C:\MinGW\include\;
C:\MinGW\mingw32\include\;
and the duplicate path entries at the bottom--

Code: Select all

c:\windows\system32;
%SystemRoot%\system32;
%SystemRoot%\System32\Wbem
The goal for changing the path was to reduce the number of paths to look for code, to just C:\MinGW\bin\ (to access mingw32-make.exe) and C:\wxWidgets\bin\.

I opened a DOS shell, went to c:\wxwidgets\build\msw, and ran a batch file containing only the commands--

Code: Select all

mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=0 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=debug
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=0 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=release
The compilations appear to compile correctly.

Still in the DOS shell, I went to C:\wxWidgets\samples\dataview. I edited the batch file to compile the dataview sample folder as follows:

Code: Select all

rem set CodeLiteDir=C:\CodeLite
rem set WXCFG=gcc_dll\mswud
rem set WXWIN=C:\wxWidgets

mingw32-make.exe -f makefile.gcc SHARED=0 MONOLITHIC=0 CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11" BUILD=debug
So, no environment variables WXCFG or WXWIN. I ran the batch file. The compilation appeared to compile correctly.

I returned to File Manager, navigated to C:\wxWidgets\samples\dataview\gcc_mswud, and double-clicked dataview.exe. Windows displayed the error message:

Code: Select all

"The application was unable to start correctly (0xc000007b). Click OK to close the application."
I will next follow up on the suggestions in https://answers.microsoft.com/en-us/off ... a5b764decb.
Last edited by ColleenKobe on Fri Jul 07, 2017 3:46 pm, edited 1 time in total.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4183
Joined: Sun Jan 03, 2010 5:45 pm

Re: How do I Compile wxWidgets Sample Code?

Post by PB »

You wrote that you removed both

Code: Select all

C:\MinGW\bin\;
C:\TDM-GCC-32\bin\;
from the path, which compiler did you use then. You wrote that it was MinGW but are you sure? To make sure which build tools you are using, you might use "where" command, e.g. "where gcc.exe" will tell you where in the PATH was file gcc.exe found.

The error you are getting is probably missing/mismatched CRT DLLs. You can use e.g. Dependency Walker to see which DLLs an .EXE is load-time linked with. OTOH, if it were just missing DLLs, Windows should just tell you which ones are missing.

BTW, MinGW-built (GCC 5.3, mingw32-make -f makefile.gcc BUILD=debug CXXFLAGS="-std=gnu++11") dataview sample requires

Code: Select all

libgcc_s_dw2-1.dll
libstdc++-6.dll
User avatar
ColleenKobe
Earned some good credits
Earned some good credits
Posts: 109
Joined: Mon Aug 31, 2015 3:47 pm

Re: How do I Compile wxWidgets Sample Code?

Post by ColleenKobe »

PB, Thanks for responding so quickly.

I made a mistake on one line in my post, which is where I said I deleted C:\MinGW\bin from my path. I added C:\MinGW\bin back into the path when Windows couldn't find mingw32-make.exe, but I forgot to delete that line from my post. I have fixed the post.

After reading your reply, I opened a command prompt and typed the following:

Code: Select all

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

U:\>path
PATH=C:\WINDOWS;C:\WINDOWS\system32\;C:\WINDOWS\System32\Wbem\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Windows\system32\config\systemprofile\.dnx\bin\;C:\ProgramData\Oracle\Java\javapath\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static\;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86\;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\KEDITW\;C:\Program Files (x86)\KEDITW\User\;C:\MinGW\bin\;C:\wxWidgets\bin\;C:\wxWidgets\;C:\wxWidgets\build\msw\gcc_mswu\;C:\wxWidgets\include\;C:\wxWidgets\lib\gcc_dll\;F:\;F:\util\;C:\Users\Colleen\AppData\Local\Microsoft\WindowsApps;

U:\>where gcc.exe
C:\MinGW\bin\gcc.exe

U:\>
So C:\MinGW\bin\ is in my path. Just checking.

I do have libgcc_s_dw2-1.dll and libstdc++-6.dll. They reside in C:\MinGW\bin, which, as I said, is part of my path.

I have a 64-bit computer with Windows 10.

I have Dependency Walker version 2.2.6000, which is for Win32. When I tried to load C:\wxWidgets\samples\dataview\gcc_mswud\dataview.exe, Dependency Walker just hung. I had to kill it with Task Manager.

I went to http://www.dependencywalker.com/. I notice it doesn't say that Windows 10 is one of its approved operating systems.

The Windows 0xc000007b error appears to be a catch-all error condition: something is wrong but Windows doesn't say what. There are many suggested solutions online.

One possible solution is that there is a 32-bit/64-bit mismatch between my computer and the version of wxWidgets I downloaded. I know my computer is 64 bits. I do not recall whether the version of wxWidgets I downloaded was 32 or 64 bits. Is there an easy way to tell by looking at some file in my wxWidgets directory? I don't see any mention of 32- vs. 64-bit versions on https://www.wxwidgets.org/downloads/.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4183
Joined: Sun Jan 03, 2010 5:45 pm

Re: How do I Compile wxWidgets Sample Code?

Post by PB »

AFAIK, you did not download 32-bit nor 64-bit wxWidgets, you downloaded the source code only. According to what you posted, you built wxWidgets and sample as 32-bit library and application, which should have no issue running on 64-bit Windows.

BTW, Dependency Walker runs just fine (both 32-bit and 64-bit version) on my Windows 10 Pro 64-bit.

Edit
Just out of curiosity: What you get when you run "where libgcc_s_dw2-1.dll" and "wherelibstdc++-6.dll"? I mean this to rule out a posibility of different (e.g. 64-bit) versions of those DLLs being somewhere in the path.

Edit2
Could you also provide the output of "gcc -v" to make sure what compiler are you actually using?
Post Reply