Page 1 of 1

Can't build CodeLite on windows

Posted: Mon Jun 04, 2018 12:29 am
by holyblackcat
I'm trying to build CodeLite from sources, following this guide: http://codelite.org/Developers/Windows

I followed that guide as precisely as I could, but the resulting binary crashes when I try to start it. :cry:

I'm on Windows 7 x64, tell me if any other information is needed.

Here's what I did:

Code: Select all

* Dowloading stuff

As suggested here: http://codelite.org/Developers/BuildingWxWidgetsWin
Downloaded MinGW-w64-7.1-POSIX-SEH from here: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.1.0/threads-posix/seh/x86_64-7.1.0-release-posix-seh-rt_v5-rev2.7z

Downloaded repo archive of this commit: https://github.com/eranif/codelite/tree/66ed0bca1d4c13dea1079ce1dba839d2debd0ad8

Downloaded wxWidgets 3.1.1 source from there: https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.7z

Downloaded codelite-amd64-12.0.0 installer from here: https://downloads.codelite.org/

Unzipped the compiler into X:\mingw64.
Unzipped codelite sources into X:\codelite
Unzipped wxWidgets into X:\wxWidgets-3.1.1

Installed CodeLite, went through configuration wizard. It detected the compiler in X:\mingw64

* Building wxWidgets as described here: http://codelite.org/Developers/BuildingWxWidgetsWin

Opened console:

	> PATH=X:\mingw64\bin
	> g++ --version
	g++ (x86_64-posix-seh-rev2, Built by MinGW-W64 project) 7.1.0
	Copyright (C) 2017 Free Software Foundation, Inc.
	This is free software; see the source for copying conditions.  There is NO
	warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
	> cd wxWidgets-3.1.1\build\msw
	> mingw32-make -f makefile.gcc setup_h SHARED=1 UNICODE=1 BUILD=release VENDOR=cl

Opened X:\wxWidgets-3.1.1\lib\gcc_dll\mswu\wx\setup.h
Removed preprocessor logic for determining value of wxUSE_GRAPHICS_CONTEXT and replaced it with #define wxUSE_GRAPHICS_CONTEXT 1

Back into the console:

	> mingw32-make -j4 -f Makefile.gcc SHARED=1 UNICODE=1 BUILD=release VENDOR=cl CXXFLAGS="-fno-keep-inline-dllexport -std=c++11"
	
Waited 20 minutes, it seems to have compiled successfully.

* Building CodeLite itself, as described here: http://codelite.org/Developers/Windows

Opened CodeLite, in it opened LiteEditor.workspace
Changed configuration to Win_x64_Release
In workspace settings, added env variable WXWIN=X:/wxWidgets-3.1.1
`CodeLiteIDE` project is selected (bolded)
Pressed F7, it asks me to select `g++-64` and `gnu g++` compilers.
Set both to that compiler I just installed.
Pressed F7 again, it starts building.

30minuteslater.jpg

"Build finished: 0 errors, 114 warnings."

Closed workspace.
Opened codelite_utils/codelite_utils.workspace
In workspace settings, added env variable WXWIN=X:/wxWidgets-3.1.1
`build_all` project is selected (bolded)
Pressed F7, it starts building.

A few minutes later.

"Build finished: 0 errors, 7 warnings."

Closed CodeLite.
Ran `Runtime/update64.bat`.

Attempted to start CodeLite (with desktop shortcut), got `Entry point _ZN10wxTreeCtrl17SetDoubleBufferedEb not found in wxmsw311u_core_gcc_cl.dll`.

Oh well.

Copied `X:\wxWidgets-3.1.1\lib\gcc_dll\*.dll` into CodeLite folder.

Tried to start it again. A splashscreen appeared, then it crashed.

Oh well. [2]

Fired up my postmortem debugger, it says 0xC000041D (STATUS_FATAL_USER_CALLBACK_EXCEPTION).
The full debugger report is here: https://pastebin.com/sBiQsFTe
What do I need to do differently?

Re: Can't build CodeLite on windows

Posted: Mon Jun 04, 2018 1:22 am
by holyblackcat
On IRC I was suggested to delete wxCrafter plugin, doing so fixes the crash.

I don't really need that plugin (nor I know what's it for), but I still wonder what was wrong.

Re: Can't build CodeLite on windows

Posted: Mon Jun 04, 2018 10:30 pm
by eranif
The plugin was probably was built with a different API from the sources you got which caused the crash
This plugin is used for designing the UI of CodeLite (or any wxWidgets application)