Page 1 of 1

Problem compiling wxMSW 2.8.12

Posted: Fri Oct 19, 2012 4:10 pm
by nmontec
Hello Everyone,
I am using cygwin with gcc 3.4.4 and would like to compile wxMSW 2.8.12.
I am following the explanations here: http://wiki.wxwidgets.org/Cygwin
After launching make, it does compile a lot of stuff and eventually it hangs on this:

$ make
/home/nmontecc/wxMSW-2.8.12/build-debug/bk-deps g++ -c -o corelib_dirctrlg.o -D__WXMSW__ -DWXBUILDING -I../src/tiff -I../src/jpeg -I../src/png -I../src/zlib -I../src/expat/lib -DwxUSE_BASE=0 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -I/home/nmontecc/wxMSW-2.8.12/build-debug/lib/wx/include/msw-ansi-debug-static-2.8 -I../include -Wall -Wundef -Wno-ctor-dtor-privacy -ggdb -O0 ../src/generic/dirctrlg.cpp
../src/generic/dirctrlg.cpp:67:24: direct.h: No such file or directory
../src/generic/dirctrlg.cpp: In function `int setdrive(int)':
../src/generic/dirctrlg.cpp:302: error: `_chdrive' undeclared (first use this function)
../src/generic/dirctrlg.cpp:302: error: (Each undeclared identifier is reported only once for each function it appears in.)
../src/generic/dirctrlg.cpp: In function `bool wxIsDriveAvailable(const wxString&)':
../src/generic/dirctrlg.cpp:351: error: `_getdrive' undeclared (first use this function)
Makefile:28340: recipe for target `corelib_dirctrlg.o' failed
make: *** [corelib_dirctrlg.o] Error 1

Can anyone understand what is it complaining of?
Thanks a lot for your help
Nicola

Re: Problem compiling wxMSW 2.8.12

Posted: Sat Oct 20, 2012 8:43 am
by nmontec
I found the same issue trying also the previous stable release and 2.9.4as well. It seems something is missing there but I don't understand what.
Does anyone have a clue about it?

Re: Problem compiling wxMSW 2.8.12

Posted: Sat Oct 20, 2012 9:44 am
by doublemax
I don't know too much about using gcc, but "direct.h" is not a file from wxWidgets, it comes with the compiler. Does it exist on your system and are your include directories set correctly?

Re: Problem compiling wxMSW 2.8.12

Posted: Thu Sep 26, 2013 7:29 am
by jmadom
problem is wrong defines on code

change defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
for
defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1

Please note that direct.h not exists on cygwin environment, is a mingw include.

please apply patch from 2.8.0 version to solve problem

--- dirctrlg.cpp 2013-09-25 19:07:52.343750000 +0200
+++ dirctrlg.cpp~ 2013-09-25 18:28:37.828125000 +0200
@@ -62,7 +62,7 @@
// FIXME - Mingw32 1.0 has both _getdrive() and _chdrive(). For now, let's assume
// older releases don't, but it should be verified and the checks modified
// accordingly.
-#if !defined(__GNUWIN32__) || (defined (__MINGW32__) && defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
+#if !defined(__GNUWIN32__) || (defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
#if !defined(__WXWINCE__)
#include <direct.h>
#endif
@@ -298,7 +298,7 @@
#ifdef __WXWINCE__
return 0;
#elif defined(__GNUWIN32__) && \
- (defined (__MINGW32__) && defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
+ (defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
return _chdrive(drive);
#else
wxChar newdrive[4];
@@ -340,7 +340,7 @@
if (dirName.length() == 3 && dirName[(size_t)1] == wxT(':'))
{
wxString dirNameLower(dirName.Lower());
-#if defined(__GNUWIN32__) && !(defined (__MINGW32__) && defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
+#if defined(__GNUWIN32__) && !(defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1)
success = wxDirExists(dirNameLower);
#else
#if defined(__OS2__)

Re: Problem compiling wxMSW 2.8.12

Posted: Mon Sep 30, 2013 8:24 am
by jmadom
I attach patch to make wxWidgets 2.8.10 compile on latest version of cygwin 1.7.25

This patch fixes two bugs:

* Avoid includes of direct.h
* Fix a bug on GetCommandLine Implementation of cygwin (1.7.22 or above) and parse cmdLine form WinMain params

I expect patch works for 2.8.12 and above

Re: Problem compiling wxMSW 2.8.12

Posted: Mon Sep 30, 2013 10:06 am
by doublemax
I don't know if the patch is correct, but i think you should also post this on trac: http://trac.wxwidgets.org/

Re: Problem compiling wxMSW 2.8.12

Posted: Wed Dec 09, 2015 11:04 am
by jmadom
I attach patch to make wxWidgets 2.8.10 compile on latest version of cygwin 2.2.0

This patch fixes two bugs:

* Avoid includes of direct.h
* Fix a bug on GetCommandLine Implementation of cygwin (1.7.22 or above) and parse cmdLine form WinMain params
* Fix a issue on treectrl.cpp (i think is a wrong deffinition on cygwin w32api includes files) but patch allows compile
* Include a new file configure.cygwin that avoids linking problems with libuuid when cygwing has installed libuuid-devel package
(Please view viewtopic.php?t=33849) force linking agains (lib/w32api/libuuid.a) instead of /lib/libuuid.dll.a through export LDFLAGS on configure.cygwin

Re: Problem compiling wxMSW 2.8.12

Posted: Wed Dec 09, 2015 11:20 am
by jmadom
I update LDFLAGS on previous patch with a complete configure.cygwin to get wxwidgets compile sucessfully and avoid undefined references for _IID_IPersistFile on linking with uuid library

$ cat configure.cygwin
export CPPFLAGS='-w -fpermissive -D__USE_W32_SOCKETS'; export LDFLAGS='-L /lib/w32api/'; ./configure --prefix=/usr/local --with-msw