Building codelite from source (Windows) fails.

CodeLite installation/troubleshooting forum
soMan
CodeLite Enthusiast
Posts: 30
Joined: Tue Apr 03, 2012 1:18 am
Genuine User: Yes
IDE Question: C++
Contact:

Building codelite from source (Windows) fails.

Post by soMan »

Trying to build cl from svn on Windows 7 x86.
CodeLite rev. 5548
wxWidgets 2.9.3
gcc 4.7.0 (MinGW)

wxWidgets release dll's was build with following configuration:

Code: Select all

# Compiler flags to link shared library 
LINK_DLL_FLAGS ?= -shared

# Compiler flags to link loadable module 
LINK_MODULE_FLAGS ?= -shared

# C compiler 
CC = gcc

# C++ compiler 
CXX = g++

# Standard flags for CC 
CFLAGS ?= 

# Standard flags for C++ 
CXXFLAGS ?= 

# Standard preprocessor flags (common for CC and CXX) 
CPPFLAGS ?= 

# Standard linker flags 
LDFLAGS ?= 

# The C preprocessor 
CPP ?= $(CC) -E

# What type of library to build? [0,1]
SHARED ?= 1

# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0

# Compile Unicode build of wxWidgets? [0,1]
UNICODE ?= 1

# Use MSLU library when building Unicode version. [0,1]
MSLU ?= 0

# Type of compiled binaries [debug,release]
BUILD ?= release

# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default

# Value of wxDEBUG_LEVEL. The default value is the same as 1 and means that all
# but expensive assert checks are enabled, use 0 to completely remove debugging
# code. [0,1,default]
DEBUG_FLAG ?= 0

# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 0

# Build GUI libraries? [0,1]
USE_GUI ?= 1

# Build wxHTML library (USE_GUI must be 1)? [0,1]
USE_HTML ?= 1

# Build wxWebView library (USE_GUI must be 1)? [0,1]
USE_WEBVIEW ?= 1

# Build multimedia library (USE_GUI must be 1)? [0,1]
USE_MEDIA ?= 1

# Build wxXRC library (USE_GUI must be 1)? [0,1]
USE_XRC ?= 1

# Build wxAUI library (USE_GUI must be 1)? [0,1]
USE_AUI ?= 1

# Build wxRibbon library (USE_GUI must be 1)? [0,1]
USE_RIBBON ?= 1

# Build wxPropertyGrid library (USE_GUI must be 1)? [0,1]
USE_PROPGRID ?= 1

# Build wxRichTextCtrl library (USE_GUI must be 1)? [0,1]
USE_RICHTEXT ?= 1

# Build wxStyledTextCtrl library (USE_GUI must be 1)? [0,1]
USE_STC ?= 1

# Build OpenGL canvas library (USE_GUI must be 1)? [0,1]
USE_OPENGL ?= 1

# Build quality assurance classes library (USE_GUI must be 1)? [0,1]
USE_QA ?= 0

# Enable exceptions in compiled code. [0,1]
USE_EXCEPTIONS ?= 1

# Enable run-time type information (RTTI) in compiled code. [0,1]
USE_RTTI ?= 1

# Enable threading in compiled code. [0,1]
USE_THREADS ?= 1

# Enable wxCairoContext for platforms other than Linux/GTK. [0,1]
USE_CAIRO ?= 0

# Is this official build by wxWidgets developers? [0,1]
OFFICIAL_BUILD ?= 0

# Use this to name your customized DLLs differently 
VENDOR ?= custom

#  
WX_FLAVOUR ?= 

#  
WX_LIB_FLAVOUR ?= 

# Name of your custom configuration. This affects directory
# where object files are stored as well as the location of
# compiled .lib files and setup.h under the lib/ toplevel directory. 
CFG ?= 

# Compiler flags needed to compile test suite in tests directory. If you want
# to run the tests, set it so that the compiler can find CppUnit headers. 
CPPUNIT_CFLAGS ?= 

# Linker flags needed to link test suite in tests directory. If you want
# to run the tests, include CppUnit library here. 
CPPUNIT_LIBS ?= 

# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= dynamic

# Set the version of your Mingw installation here.
#     "3" ...... this is for Mingw 2.0 or newer (comes with gcc3)
#     "2.95" ... for Mingw 1.1 or any of the older versions [3,2.95]
GCC_VERSION ?= 3
When I was building with DEBUG_FLAG ?= 0 (other options are the same), I hadn't got the errors below.

Here is the log of codelite_utils.workspace building fail:

Code: Select all

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 1 -f "codelite_utils_wsp.mk""
----------Building project:[ autorev - Release ]----------
mingw32-make.exe[1]: Entering directory `C:/codelite/AutoRevision/autorev'
g++  -c  "C:/codelite/AutoRevision/autorev/main.cpp"  -o ./Release/main.o -I. -I. 
g++ -o ../../LiteEditor/autorev @"C:\codelite\AutoRevision\autorev\autorev.txt" -L.   -O2
mingw32-make.exe[1]: Leaving directory `C:/codelite/AutoRevision/autorev'
----------Building project:[ codelite_cppcheck - Release ]----------
mingw32-make.exe[1]: Entering directory `C:/codelite/sdk/codelite_cppcheck'
g++  -c  "C:/codelite/sdk/codelite_cppcheck/cli/cppcheckexecutor.cpp"  -o ./Release/cppcheckexecutor.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/cli/main.cpp"  -o ./Release/main.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/cli/threadexecutor.cpp"  -o ./Release/threadexecutor.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkautovariables.cpp"  -o ./Release/checkautovariables.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkbufferoverrun.cpp"  -o ./Release/checkbufferoverrun.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkclass.cpp"  -o ./Release/checkclass.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkdangerousfunctions.cpp"  -o ./Release/checkdangerousfunctions.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkexceptionsafety.cpp"  -o ./Release/checkexceptionsafety.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkheaders.cpp"  -o ./Release/checkheaders.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkmemoryleak.cpp"  -o ./Release/checkmemoryleak.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkother.cpp"  -o ./Release/checkother.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkstl.cpp"  -o ./Release/checkstl.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/checkunusedfunctions.cpp"  -o ./Release/checkunusedfunctions.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/cppcheck.cpp"  -o ./Release/cppcheck.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/errorlogger.cpp"  -o ./Release/errorlogger.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/executionpath.cpp"  -o ./Release/executionpath.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/filelister.cpp"  -o ./Release/filelister.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/mathlib.cpp"  -o ./Release/mathlib.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/preprocessor.cpp"  -o ./Release/preprocessor.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/settings.cpp"  -o ./Release/settings.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/token.cpp"  -o ./Release/token.o -Ilib -I. 
g++  -c  "C:/codelite/sdk/codelite_cppcheck/lib/tokenize.cpp"  -o ./Release/tokenize.o -Ilib -I. 
g++ -o ./Release/codelite_cppcheck @"C:\codelite\sdk\codelite_cppcheck\codelite_cppcheck.txt" -L.  -lshlwapi  -O2
mingw32-make.exe[1]: Leaving directory `C:/codelite/sdk/codelite_cppcheck'
mingw32-make.exe[1]: Entering directory `C:/codelite/sdk/codelite_cppcheck'
Executing Post Build commands ...
strip -s  Release\codelite_cppcheck.exe
copy Release\codelite_cppcheck.exe ..\..\Runtime\codelite_cppcheck.exe
‘ª®¯¨à®¢ ­® ä ©«®¢:         1.
Done
mingw32-make.exe[1]: Leaving directory `C:/codelite/sdk/codelite_cppcheck'
----------Building project:[ codelite_launcher - Release ]----------
mingw32-make.exe[1]: Entering directory `C:/codelite/codelite_launcher'
g++  -c  "C:/codelite/codelite_launcher/codelite_launcher.cpp" -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:\Develop\wxWidgets\lib\gcc_dll\mswu -IC:\Develop\wxWidgets\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0    -D__WX__  -o ./Release/codelite_launcher.o -I. 
g++ -o ./Release/codelite_launcher @"C:\codelite\codelite_launcher\codelite_launcher.txt" -L.   -O2  -mthreads -LC:\Develop\wxWidgets\lib\gcc_dll -lwxmsw29u_html -lwxmsw29u_adv -lwxmsw29u_core -lwxbase29u_xml -lwxbase29u_net -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32  -mwindows -s
./Release/codelite_launcher.o:codelite_launcher.cpp:(.text$_ZN20wxArgNormalizerWcharIRK8wxStringEC2ES2_PK14wxFormatStringj[wxArgNormalizerWchar<wxString const&>::wxArgNormalizerWchar(wxString const&, wxFormatString const*, unsigned int)]+0x2e): undefined reference to `_wxTheAssertHandler'
./Release/codelite_launcher.o:codelite_launcher.cpp:(.text$_ZN20wxArgNormalizerWcharIRK8wxStringEC2ES2_PK14wxFormatStringj[wxArgNormalizerWchar<wxString const&>::wxArgNormalizerWchar(wxString const&, wxFormatString const*, unsigned int)]+0x69): undefined reference to `wxOnAssert(char const*, int, char const*, char const*, char const*)'
c:/develop/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.0/../../../../i686-w64-mingw32/bin/ld.exe: ./Release/codelite_launcher.o: bad reloc address 0x69 in section `.text$_ZN20wxArgNormalizerWcharIRK8wxStringEC2ES2_PK14wxFormatStringj[wxArgNormalizerWchar<wxString const&>::wxArgNormalizerWchar(wxString const&, wxFormatString const*, unsigned int)]'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[1]: *** [Release/codelite_launcher] Error 1
mingw32-make.exe: *** [All] Error 2
mingw32-make.exe[1]: Leaving directory `C:/codelite/codelite_launcher'
----------Build Ended----------
2 errors, 0 warnings, total time: 00:00:49 seconds
soMan
CodeLite Enthusiast
Posts: 30
Joined: Tue Apr 03, 2012 1:18 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Building codelite from source (Windows) fails.

Post by soMan »

I found a some 'hack' on this using google. As i understand these undefined references couldn't be in release mode and that is a wxWidgets' fail. To fix it we should find our setup.h file in our release configuration and uncomment five lines starting from 69:

Code: Select all

#ifdef NDEBUG
#define wxDEBUG_LEVEL 0
#else
#define wxDEBUG_LEVEL 2
#endif
It will allow us to build fully release versions without debug code.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Building codelite from source (Windows) fails.

Post by eranif »

I am not sure what is the reason for this, to me it seems like a mismatch between debug and release (the symbol wxOnAssert exists only in Debug builds of wxWidgets)

This is how I build wxWidgets (after editing setup.h):

Code: Select all

mingw32-make -j4 -f Makefile.gcc SHARED=1 UNICODE=1 BUILD=release MONOLITHIC=1 DEBUG_FLAG=0
When you changed the setup.h - you should have performed a full "rebuild" of wxWidgets

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Building codelite from source (Windows) fails.

Post by eranif »

soMan wrote:I found a some 'hack' on this using google. As i understand these undefined references couldn't be in release mode and that is a wxWidgets' fail. To fix it we should find our setup.h file in our release configuration and uncomment five lines starting from 69:

Code: Select all

#ifdef NDEBUG
#define wxDEBUG_LEVEL 0
#else
#define wxDEBUG_LEVEL 2
#endif
It will allow us to build fully release versions without debug code.
Argg ;), this is what I wrote you to do couple of days ago in Private Message:
Re: Fixed CL build
Sent at: Tue May 15, 2012 8:12 pm
From: eranif
To: soMan

IN general, looks good.
One thing though: The wxWidgets that you are using is 2.93 Release with debug level 1, this means that user might get assertions ...

To get a true Release build of wxWidgets, you need to open your setup.h file under %WXWIN%\lib\gcc_dll\mswu\wx
and around line 69

Add this:

CODE: SELECT ALL
#ifdef NDEBUG
#define wxDEBUG_LEVEL 0
#else
#define wxDEBUG_LEVEL 2
#endif


I will setup a subforum for the nightly builds
Eran
Eran
Make sure you have read the HOW TO POST thread
soMan
CodeLite Enthusiast
Posts: 30
Joined: Tue Apr 03, 2012 1:18 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Building codelite from source (Windows) fails.

Post by soMan »

Argg, this is what I wrote you to do couple of days ago in Private Message:
Damn( I forgot to make this before new rebuilding old wxWidgets. It is going some sh*t last days... Now I have a problems with mingw. Will update a nightly builds project after resolving them.
Post Reply