Issue with Codelite 14.0.4 on Windows

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
luc0x61
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Feb 07, 2021 1:26 pm

Issue with Codelite 14.0.4 on Windows

Post by luc0x61 »

I'm using MingW64 8.1.0 with Codelite 14.0.4; as I tried installing wxWidgets 3.1.4 MSW binaries I'm facing a problem with wx-config:

Code: Select all

C:\...\wtest>wx-config --version
wx-config Error: Unable to open file 'C:/wx/build/msw/config.gcc'.
3.1.4
My installation of wxWidgets binaries was just unzipping them in "C:\wx" path, but what I have is only this tree

Code: Select all

C:\wx
+--include
|  +--msvc
|  |  \--wx
|  \--wx
|     +--android
|     +--aui
|     +--dfb
|     |  \--private
|     +--generic
|     |  \--private
|     +--gtk
|     |  +--gnome
|     |  \--private
|     +--gtk1
|     |  \--private
|     +--html
|     +--meta
|     +--motif
|     |  \--private
|     +--msw
|     |  +--ole
|     |  +--private
|     |  \--rt
|     |     \--private
|     +--osx
|     |  +--carbon
|     |  |  \--private
|     |  +--cocoa
|     |  |  \--private
|     |  +--core
|     |  |  \--private
|     |  +--iphone
|     |  |  \--private
|     |  \--private
|     +--persist
|     +--private
|     +--propgrid
|     +--protocol
|     +--qt
|     |  \--private
|     +--ribbon
|     +--richtext
|     |  \--bitmaps
|     +--stc
|     +--univ
|     +--unix
|     |  \--private
|     +--x11
|     |  +--nanox
|     |  |  \--X11
|     |  \--private
|     +--xml
|     \--xrc
\--lib
   \--gcc_810_x64_dll
      +--mswu
      |  \--wx
      |     \--msw
      \--mswud
         \--wx
            \--msw
Note: I had to rename "gcc_810_x64_dll" with an additional underscore, to make Codelite accept it

Then maybe I'm missing the proper archive of binary files?
Or the only way around is just recompiling wxWidgets from sources? :-?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Issue with Codelite 14.0.4 on Windows

Post by PB »

I have little experience with prebuilt binaries, CodeLite, or wx-config; so I have no idea why would wx-config be interested in any file besides the build-specific build.cfg but still: What happens if you run

Code: Select all

wx-config --wxcfg=gcc_810_x64_dll/mswud --basename
I assume you set system environment variable WXWIN to your wxWidgets folder and that is how wx-config finds wxWidgets? If not I would add

Code: Select all

--prefix=c:\wx
to the wx-config parameters

EDIT
I can confirm the issue. It is with wx-config, so it should be reported to CodeLite developers, who maintain (this version of) wx-config. But is seems that just providing an empty file build\msw\config.gcc file seems to satisfy the tool.

However, it seems that --wxcfg parameter does not work (even with proper config.gcc copied from the full source), for example, running

Code: Select all

wx-config --cxxflags --wxcfg=gcc_810_x64_dll/mswud
outputs
-mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -Ic:/wx/lib/gcc_dll/mswud -Ic:/wx/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=gnu++11
It is the same for linker and resource compiler flags.


So it may be required not only to add an extra underscore but rename the folder to gcc_dll to workaround the wxcfg problem.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Issue with Codelite 14.0.4 on Windows

Post by ONEEYEMAN »

Hi,
You are mixing things up.
wx-config is a script that is used to build client application using wxWidgets on the *-nix based systems (Linux, OSX, UNIX).
On Windows if you don't have MSYS[2] environment you just use MinGW directly, but you need to know how exactly wxWidhets was built (debug vs release) and what compiler.
So in CodeLite you just need to go to project properties and manually add the include folders and the appropriate libraries to link.
Unless it is not already there when you created your project. But I presume, from the question, that they are not, since you can't build and need assistance.

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

Re: Issue with Codelite 14.0.4 on Windows

Post by PB »

Actually, CodeLite ships with their own version of wx-config and wx-config is used by default by CodeLite when creating wxWidgets projects on Windows.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Issue with Codelite 14.0.4 on Windows

Post by ONEEYEMAN »

Hi, PB,
Are they using it even on Windows?
I didn't know that...

Thank you.
luc0x61
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Feb 07, 2021 1:26 pm

Re: Issue with Codelite 14.0.4 on Windows

Post by luc0x61 »

PB wrote: Sun Feb 07, 2021 2:11 pm So it may be required not only to add an extra underscore but rename the folder to gcc_dll to workaround the wxcfg problem.
Thanks PB for your detailed examination of the issue, I will try later with your findings. It's all on a laptop that I've at home, with a fresh install of Win 10 and nothing more.
I already have posted the problem on Codelite forum, but it looks to be a bit less active than wxWidgets one :)
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Issue with Codelite 14.0.4 on Windows

Post by PB »

FWIW, I have reported the issue with build\msw\config file:
https://github.com/eranif/codelite/issues/2659

I reported a bug in wx-config on CodeLite forums year ago, never got any response there. OTOH, my recent fix to their wx-config was silently merged.
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Re: Issue with Codelite 14.0.4 on Windows

Post by eranif »

FWIW:
On Windows, you need to specifiy WXWIN and WXCFG to point to installation and build configuration you are interested.
For example, if you installed wxWidgets on C:\wx\

Then:

Code: Select all

WXWIN=C:\wx
WXCFG=gcc_810_x64_dll\mswu
for debug verion, just change the WXCFG to the debug build folder

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Issue with Codelite 14.0.4 on Windows

Post by PB »

Hi Eran,

as I wrote above, wx-config seems to use the string passed in wxcfg to find the build.cfg file, but NOT when assembling LIBDIRNAME where only the default values are used: LIBDIRNAME is used in both build-specific include path and the library path.

The missing part in the folder name (sans the underscore), i.e., here "810_x64" is available in cfg["COMPILER_VERSION"] but never used, see https://github.com/eranif/codelite/blob ... .cpp#L1011


For example if I run wx-config (from GIT master) with parameters
--prefix=c:/wx --wxcfg=gcc_810_x64_dll/mswud --cxxflags
it still outputs
-mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -Ic:/wx/lib/gcc_dll/mswud -Ic:/wx/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=gnu++11

I did not report this as an issue as I do not know if custom names for build folders are disallowed by design.

EDIT
If this is an actual issue, in other words a string passed in wxcfg parameter should be also used for a folder with wxWidgets build, the fix seems easy: https://github.com/PBfordev/codelite/co ... 441eac544b and the same change should be applied to the other two compilers.

However, while this makes sense I am still not sure it is supposed to work like this when no one else has had a problem with how it works.

EDIT 2
Actually, it is not that easy, cfg["COMPILER_VERSION"] is taken from build.cfg. However, this does not account for a build folder name not having compiler version in it but having an architecture in it, for example, "vc_x64_dll". At least with MSVC, the build folder name uses wxCOMPILER_PREFIX and wxARCH_SUFFIX, the latter is not available from build.cfg.
Last edited by PB on Mon Feb 08, 2021 8:55 pm, edited 2 times in total.
luc0x61
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Feb 07, 2021 1:26 pm

Re: Issue with Codelite 14.0.4 on Windows

Post by luc0x61 »

PB wrote: Mon Feb 08, 2021 7:30 pm However, while this makes sense I am still not sure it is supposed to work like this when no one else has had a problem with how it works.
I suspect the behavior with gcc 7.3 is different, and Codelite documentation still sticks with advising the use of it, and not gcc 8.1.0

In the meanwhile, I tried renaming to "C:\wx\lib\gcc_dll", updating then 'WXCFG=gcc_dll/mswud' and copying the "build\" directory from sources directly to my "c:\wx\build\" ...
That worked, for compiling, everything went smooth, though stopped in "wx\chkconf.h"

Code: Select all

#ifndef wxUSE_ANY
#   ifdef wxABORT_ON_CONFIG_ERROR
        /***  RIGHT HERE  ***/
#       error "wxUSE_ANY must be defined, please read comment near the top of this file."
#   else
#       define wxUSE_ANY 0
#   endif
#endif /* wxUSE_ANY */
oomph... Configuration isn't proper then, I'll investigate it when I have some more time
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: Issue with Codelite 14.0.4 on Windows

Post by PB »

luc0x61 wrote: Mon Feb 08, 2021 8:50 pm
PB wrote: Mon Feb 08, 2021 7:30 pm However, while this makes sense I am still not sure it is supposed to work like this when no one else has had a problem with how it works.
I suspect the behavior with gcc 7.3 is different, and Codelite documentation still sticks with advising the use of it, and not gcc 8.1.0
This has nothing to do with GCC, this is a wx-config issue.
Post Reply