Skip to content

Build fails for wxWidgets 3.1 #2

Description

@rcortini

When compiling against wxWidgets 3.1, build fails because of wrong CFLAGS and LDFLAGS. Suggested fix:

  • add the wxwin.m4 file to the source distribution (available from the wxWidgets distribution)
  • apply the following patch
diff --git a/configure.ac b/configure.ac
index 0ef077e..3b014de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,11 +15,34 @@ AC_PROG_CXX
 # Checks for libraries & headers.
 LT_INIT([dlopen])

-WX_CFLAGS=`wx-config --version=2.8 --cflags`
-WX_LIBS=`wx-config --version=2.8 --libs`
-AC_SUBST(WX_CFLAGS)
+m4_include([wxwin.m4])
+AM_OPTIONS_WXCONFIG
+reqwx=2.8.0
+AM_PATH_WXCONFIG($reqwx, wxWin=1)
+if test "$wxWin" != 1; then
+   AC_MSG_ERROR([
+       wxWidgets must be installed on your system.
+ 
+       Please check that wx-config is in path, the directory
+       where wxWidgets libraries are installed (returned by
+       'wx-config --libs' or 'wx-config --static --libs' command)
+       is in LD_LIBRARY_PATH or equivalent variable and
+       wxWidgets version is $reqwx or above.
+       ])
+else
+  WX_CFLAGS=`wx-config --cflags`
+  WX_LIBS=`wx-config --libs`
+fi
+
+AC_SUBST(WX_INCLUDES)
 AC_SUBST(WX_LIBS)

+
+# WX_CFLAGS=`wx-config --version=2.8 --cflags`
+# WX_LIBS=`wx-config --version=2.8 --libs`
+# AC_SUBST(WX_CFLAGS)
+# AC_SUBST(WX_LIBS)
+
 PKG_CHECK_MODULES([CB], [codeblocks])
 AC_SUBST(CB_CFLAGS)
 AC_SUBST(CB_LIBS)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions