Compiling CodeLite under Windows 7 / 64 bit fails

Discussion about CodeLite development process and patches
tlang
CodeLite Enthusiast
Posts: 11
Joined: Thu May 22, 2014 2:08 pm
Genuine User: Yes
IDE Question: C++
Contact:

Compiling CodeLite under Windows 7 / 64 bit fails

Post by tlang » Thu May 22, 2014 2:39 pm

Hi there,
to get debugging on embedded systems to work (*) I just fetched CodeLite from github and tried to compile according to http://codelite.org/Developers/Windows#toc1. Compiling fails quite early with the following output:

Code: Select all

C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 8 -e -f  Makefile"
----------Building project:[ PCH - Debug ]----------
mingw32-make[1]: Entering directory 'd:/Projekte.git/Intern/codelite_test/PCH'
g++ -c  precompiled_header_dbg.h -g -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:/wxWidgets-3.0.0/lib/gcc_dll/mswud -IC:/wxWidgets-3.0.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport    -I. -I.
mingw32-make[1]: Leaving directory 'd:/Projekte.git/Intern/codelite_test/PCH'
mingw32-make[1]: Entering directory 'd:/Projekte.git/Intern/codelite_test/PCH'
g++ -include precompiled_header_dbg.h  -c  "D:/Projekte.git/Intern/codelite_test/PCH/dummy.cpp" -g -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:/wxWidgets-3.0.0/lib/gcc_dll/mswud -IC:/wxWidgets-3.0.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport    -o ./Debug/dummy.o -I. -I.
ar rcus ./Debug/libPCH.a @"PCH.txt"
mingw32-make[1]: Leaving directory 'd:/Projekte.git/Intern/codelite_test/PCH'
----------Building project:[ sqlite3 - Common ]----------
mingw32-make[1]: Entering directory 'd:/Projekte.git/Intern/codelite_test/sqlite3'
gcc -c  "D:/Projekte.git/Intern/codelite_test/sqlite3/sqlite3.c" -O2  -o ./Release_static/sqlite3.o -I. -I.
ar rcus ../lib/gcc_lib/libsqlite3.a @"sqlite3.txt"
mingw32-make[1]: Leaving directory 'd:/Projekte.git/Intern/codelite_test/sqlite3'
----------Building project:[ wxsqlite3 - WinDebugUnicode ]----------
mingw32-make[1]: Entering directory 'd:/Projekte.git/Intern/codelite_test/sdk/wxsqlite3'
mingw32-make[1]: '../../PCH/precompiled_header_dbg.h.gch' is up to date.
mingw32-make[1]: Leaving directory 'd:/Projekte.git/Intern/codelite_test/sdk/wxsqlite3'
mingw32-make[1]: Entering directory 'd:/Projekte.git/Intern/codelite_test/sdk/wxsqlite3'
g++ -include ../../PCH/precompiled_header_dbg.h  -c  "D:/Projekte.git/Intern/codelite_test/sdk/wxsqlite3/src/wxsqlite3.cpp" -g -mthreads -DHAVE_W32API_H -D__WXMSW__ -D__WXDEBUG__ -D_UNICODE -IC:/wxWidgets-3.0.0/lib/gcc_dll/mswud -IC:/wxWidgets-3.0.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport   -Winvalid-pch -D__WX__ -DWXUSINGDLL -DWXMAKINGDLL_WXSQLITE3  -o ./WinDebugUnicode/src_wxsqlite3.o -I. -I. -I./include -I./sqlite3/include
g++ -shared -fPIC -o ../../lib/gcc_lib/libwxsqlite3ud.dll @"wxsqlite3.txt" -L. -L../../lib/gcc_lib/  -lsqlite3   -mthreads -LC:/wxWidgets-3.0.0/lib/gcc_dll -lwxmsw30ud_xrc -lwxmsw30ud_aui -lwxmsw30ud_html -lwxmsw30ud_adv -lwxmsw30ud_core -lwxbase30ud_xml -lwxbase30ud_net -lwxmsw30ud_richtext -lwxbase30ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexud -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32
mingw32-make[1]: Leaving directory 'd:/Projekte.git/Intern/codelite_test/sdk/wxsqlite3'
mingw32-make[1]: Entering directory 'd:/Projekte.git/Intern/codelite_test/sdk/wxsqlite3'
Executing Post Build commands ...
copy ..\..\lib\gcc_lib\libwxsqlite3ud.dll ..\..\Runtime
process_begin: CreateProcess(NULL, copy ..\..\lib\gcc_lib\libwxsqlite3ud.dll ..\..\Runtime, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
mingw32-make[1]: *** [PostBuild] Error 2
wxsqlite3.mk:88: recipe for target 'PostBuild' failed
mingw32-make[1]: Leaving directory 'd:/Projekte.git/Intern/codelite_test/sdk/wxsqlite3'
mingw32-make.exe: *** [All] Error 2
Makefile:4: recipe for target 'All' failed
0 errors, 0 warnings, total time: 00:00:38 seconds
For compiling I used
CodeLite 5.4 binary (out of the box with no special global settings)
wxWidgets 3.0 (installed to the default path)
MingW 4.8.1 (installed to the default path)

When mingw32-make tries to start a "copy" with CreateProcess it's clear to me why this fails as there is no executable "copy" command around under Windows 7/64 (**). But with which package would the missing "copy" be delivered?

Regards,
Torsten

(*) There was a binary only CM3 debugger DLL around in these forums a longer time ago, but it does not seem to work any more with the current CodeLite 5.4. As I could not find any sources/patches released by the author I planned to do something on my own to get the debugger working with "bare metal" projects on ARM (using the J-Link as JTAG/SWD interface).
(**) I did a fixup to use xcopy instead which seems to work if I also adapt several IntermediateDir settings. But now The build fails because of the "MakeDirCommand := makedir" entries in the .mk files. Where does this come from? As with "copy" "makedir" doesn't exist on my system...

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

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by eranif » Thu May 22, 2014 3:49 pm

tlang wrote:"copy" command around under Windows 7/64 (**)
I thought that copy is the default copy command under Windows...
tlang wrote:But now The build fails because of the "MakeDirCommand := makedir"
makedir comes with codelite. It should be under CODELITE_INSTALL_PATH/makedir.exe

Did you change any of the environment variables inside codelite? (Settings -> Environment Variables)
Also, you can provide your own MakeDirCommand by defining it as an environment variable within codelite ((Settings -> Environment Variables):

For example, if you had mkdir installed on Windows, you could set it like this:

Code: Select all

MakeDirCommand=mkdir -p
Eran
Make sure you have read the HOW TO POST thread

tlang
CodeLite Enthusiast
Posts: 11
Joined: Thu May 22, 2014 2:08 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by tlang » Thu May 22, 2014 5:27 pm

Hi Eran,
a path to an msys installation seems causing the headaches. Although this entry comes behind the MinGW path strange effects happen (like "copy" not working - although I still don't understand where the command comes from / why mingw32-make tries to start "copy" by CreateProcess) and "makedir" leading to a sh being started and then failing.

As I use these paths for other projects I now have set up a minimalistic path in the CodeLite environment variable settings:

Code: Select all

PATH=C:\GNU\MinGW-4.8.1\bin;%CodeLiteDir%
I still get a lot of warnings like

Code: Select all

g++ -shared -fPIC -o ./WinReleaseUnicode/snipwiz.dll @"snipwiz.txt" -L. -L../lib/gcc_lib  -lplugin_sdku -lcodeliteu -lwxsqlite3u  -O2  -mthreads -LC:/wxWidgets-3.0.0/lib/gcc_dll -lwxmsw30u_richtext -lwxmsw30u_xrc -lwxmsw30u_aui -lwxmsw30u_html -lwxmsw30u_adv -lwxmsw30u_core -lwxbase30u_xml -lwxbase30u_net -lwxbase30u -lwxscintilla -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32  -s
c:/gnu/mingw-4.8.1/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lplugin_sdku
c:/gnu/mingw-4.8.1/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lcodeliteu
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe: *** [WinReleaseUnicode/snipwiz.dll] Error 1
snipwiz.mk:80: recipe for target 'WinReleaseUnicode/snipwiz.dll' failed
0 errors, 66 warnings
I don't know what I should think of (looks like broken dependencies - after a second iteration the build passes) but at least compilation does not stop any longer.

Regards,
Torsten

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

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by eranif » Thu May 22, 2014 5:36 pm

Make sure that the MinGW is the first in the PATH and _not_ MSYS
It will never work with MSYS (search the forum for the word "SHELL")

Eran
Make sure you have read the HOW TO POST thread

tlang
CodeLite Enthusiast
Posts: 11
Joined: Thu May 22, 2014 2:08 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by tlang » Thu May 22, 2014 6:34 pm

Hi Eran,
as said, I had MinGW before MSYS in my path, nevertheless comilation failed.

As compilation worked with the minimalized path I tried to install the new version. Result: CodeLite hangs immediately when showing the splash screen. To check out if it had to do with the latest version I switched to the official version 5.4 and complied again. Same result.

After running the 5.4 installer the installation worked again. So something still has to be wrong with my compiled projects.

Regards,
Torsten

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

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by eranif » Thu May 22, 2014 6:51 pm

How do you build codelite in the first place?
What you should do is:
- Make sure that the project 'LiteEditor' is selected (its font will be in bold)
- Hit F7

This way you make sure that the projects are built in the correct order.
The link error you got means that SnipWiz (which is a plugin) is being built before the SDK dlls (libcodelite and libplugin)
This can only happen when the build is not done in the correct build order (Build Project LiteEditor ensures that all the projects are built in the correct order)

Eran
Make sure you have read the HOW TO POST thread

solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by solewalker » Thu May 22, 2014 9:20 pm

I was also having the same issue. But few weeks ago that I tried it worked properly. Was thinking what changed in my system. Then I searched a bit, with "make (e=2): The system cannot find the file specified." on google, and got this post https://www.allegro.cc/forums/thread/59 ... 382#target so I fired up cmd and typed 'sh', and there is a sh.exe in my path. So next I tried, where sh, found out I installed ruby few days ago and it contains an sh.exe in its bin folder. I renamed the sh.exe and try to build, it build and compiled properly :D

In short, check for any sh.exe or bash.exe in your path, then try renaming it or remove it from the path, build should work now :)

tlang
CodeLite Enthusiast
Posts: 11
Joined: Thu May 22, 2014 2:08 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by tlang » Fri May 23, 2014 6:04 pm

Hi Eran,
I retried the build as you described. The compile of the two workspaces now run through at the first attempt, but after updating CodeLite still does hang when showing the splash screen (tried again with 5.4 as at least this should run). What I wondering about are two messages about missing files/wrong paths during the update.bat run (full log is attached):

Code: Select all

...
Ungltiger Pfad
0 Datei(en) kopiert
...
Datei wxrc.exe nicht gefunden
0 Datei(en) kopiert
...
I also have attached the build logs of the two workspaces in the hope that you can see a difference when diffing with your (succesful) build...

Regards,
Torsten
You do not have the required permissions to view the files attached to this post.

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

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by eranif » Fri May 23, 2014 7:03 pm

Try deleting/renaming the folder %APPDATA%\CodeLite

Eran
Make sure you have read the HOW TO POST thread

solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Compiling CodeLite under Windows 7 / 64 bit fails

Post by solewalker » Fri May 23, 2014 8:29 pm

Tlang, are you sure there is no sh.exe or bash.exe in your path? Because I was having the same issue, and fixed it by removing sh.exe from system path.

Post Reply