Cannot build a wxWidgets application on windows

CodeLite installation/troubleshooting forum
willliamford35
CodeLite Enthusiast
Posts: 22
Joined: Sun Nov 27, 2022 1:37 am
Genuine User: Yes
IDE Question: C++
Contact:

Cannot build a wxWidgets application on windows

Post by willliamford35 »

I am attempting to build a large wxWidgets application with the following directory structure:
<Directory name>
include
src

wxWidgets-3.2.2.1 was installed on M1 Windows 11 from prebuilt windows binaries

wxMSW-3.2.2_gcc1220_x64_Dev.7z
wxMSW-3.2.2_gcc1220_x64_ReleaseDLL.7z
wxWidgets-3.2.2.1-headers.7z

installed in
C:/wxWidgets-3.2.2.1/include
C:/wxWidgets-3.2.2.1/lib

C++ Compiler Options:
-O0;-w;-gdwarf-2;-std=gnu++11;$(shell wx-config --prefix=C:/wxWidgets-3.2.2.1 --wxcfg=gcc_dll/mswu --cxxflags --unicode=yes )

A particular include and source file that fail to compile are

report.h

Code: Select all

#include "wx/string.h"
  #include <wx/msgdlg.h>

  void report (const wxString& msg, const wxString& caption);

report.cpp

Code: Select all

  #include "report.h"

  void report (const wxString& msg, const wxString& caption)
  {
     wxMessageDialog dialog (NULL, msg, caption, wxOK | wxICON_INFORMATION);
     dialog.ShowModal();
  }

Here are the error messages:

Code: Select all

C:/msys64/usr/bin/make.exe -j4 -e -f  "Alice.mk"  MakeIntermediateDirs && C:/msys64/usr/bin/make.exe -j4 -e -f  "Alice.mk"  build-Debug/src_report.cpp.o
----------Building project:[ Alice - Debug ] (Single File Build)----------
/bin/sh: -c: line 2: syntax error: unexpected end of file
make: *** [Alice.mk:86: MakeIntermediateDirs] Error 2
=== build completed successfully (0 errors, 0 warnings) ===

I get this message no matter what source file I attempt to compile. I have tried multiple compilers, all installed with MSYS2.

I have been successful in building my application on M1/Ventura, x86_64/Ventura/, M1/Ubuntu 22.04 and x86_64/Ubuntu 22.04, all with CodeLite.

I hope you can help me.

Thanks.

Last edited by DavidGH on Tue Sep 26, 2023 12:56 pm, edited 1 time in total.
Reason: Added code-tags
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Cannot build a wxWidgets application on windows

Post by DavidGH »

Hi,

I don't use MSW, so this only is a general answer.

What happens if you try to build the 'Console' sample projects that come with CodeLite? First try one of the 'Simple Executable' ones without wxWidgets. If that compiles OK, try one that's with it.

If that latter fails, there must be something wrong with your wx install, or else your compiler/linker settings aren't finding it. If it succeeds, compare the compiler/linker settings with those of your project.

Regards,

David

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Cannot build a wxWidgets application on windows

Post by eranif »

The problem is that you are mixing MSYS2 make and MinGW
For example:

You are using the make from MSYS2, while you should probably be using mingw32-make (located in the same path)

When you use make (as opposed to using mingw32-make) you should be using the makefile generator that has the "UNIX" in its name (project settings -> general page -> makefile generator)

Make sure you have read the HOW TO POST thread
Post Reply