Problem compiling wxMSW 2.8.12

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.
Post Reply
nmontec
Earned a small fee
Earned a small fee
Posts: 13
Joined: Wed Nov 29, 2006 4:40 pm
Location: Italy
Contact:

Problem compiling wxMSW 2.8.12

Post by nmontec » Fri Oct 19, 2012 4:10 pm

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

nmontec
Earned a small fee
Earned a small fee
Posts: 13
Joined: Wed Nov 29, 2006 4:40 pm
Location: Italy
Contact:

Re: Problem compiling wxMSW 2.8.12

Post by nmontec » Sat Oct 20, 2012 8:43 am

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?

User avatar
doublemax
Moderator
Moderator
Posts: 13985
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problem compiling wxMSW 2.8.12

Post by doublemax » Sat Oct 20, 2012 9:44 am

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?
Use the source, Luke!

jmadom
In need of some credit
In need of some credit
Posts: 5
Joined: Thu Sep 26, 2013 7:20 am

Re: Problem compiling wxMSW 2.8.12

Post by jmadom » Thu Sep 26, 2013 7:29 am

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__)

jmadom
In need of some credit
In need of some credit
Posts: 5
Joined: Thu Sep 26, 2013 7:20 am

Re: Problem compiling wxMSW 2.8.12

Post by jmadom » Mon Sep 30, 2013 8:24 am

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
Attachments
patch_wxWidgets-2.8.10_for_cygwin_1.7.25.diff
Patch for cygwin 1.7.25
(3.33 KiB) Downloaded 118 times

User avatar
doublemax
Moderator
Moderator
Posts: 13985
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problem compiling wxMSW 2.8.12

Post by doublemax » Mon Sep 30, 2013 10:06 am

I don't know if the patch is correct, but i think you should also post this on trac: http://trac.wxwidgets.org/
Use the source, Luke!

jmadom
In need of some credit
In need of some credit
Posts: 5
Joined: Thu Sep 26, 2013 7:20 am

Re: Problem compiling wxMSW 2.8.12

Post by jmadom » Wed Dec 09, 2015 11:04 am

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
Attachments
wxWidgets-2.8.10_cygwin_2.2.0.diff
(27.39 KiB) Downloaded 47 times

jmadom
In need of some credit
In need of some credit
Posts: 5
Joined: Thu Sep 26, 2013 7:20 am

Re: Problem compiling wxMSW 2.8.12

Post by jmadom » Wed Dec 09, 2015 11:20 am

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

Post Reply