Codelite 17.0.0 occurs "process_begin: CreateProcess(NULL, makedir Debug, ...) failed." - codelite

I am just learning C++ via Codelite, which was updated on 01/11. After updating to the latest version, 17.0.0, I get the error
process_begin: CreateProcess(NULL, makedir Debug, ...) failed.
mingw32-make[1]: *** [AssignmentOperator.mk:90: Debug/.d] Error 2,
mingw32-make: *** [Makefile:5: All] Error 2
when I run a simple code.
#include <iostream>
int main(){
std::cout<<"Hello"<<std::endl;
return 0;
}
and get nothing in the terminal window.
How can I fix this problem? Thanks a lot.
I guess the probrem occured since the updating of Codelite, but I have no idea how to fix it.

Looks like a an old relic that was not handled properly during upgrade.
This can be fixed in 2 ways:
Update the mkdir command as defined by your compiler setup:
Go to Settings -> build settings and select your compiler from the list
Select the Tools tab
Select the last entry at the bottom mkdir
Replace the content with the mkdir that comes with CodeLite, for example, if you have installed CodeLite under C:\Program Files\CodeLite (the default path), set it to
"C:/Program Files/CodeLite/mkdir.exe" -p
Notice the double quotes around the command itself
Change the makefile generator used
Right click on your project and open the project settings
In the General tab, under the Makefile Generator change the selection from Default -> CodeLite Makefile Generator

I'm using Mac OS 13.1, and codelite 17.0.0, and when I 'clean', build completed successfully. But when I run its show 'make: ***[All] Error 2.
What happened? just new to learn C++

I had the same problem with Codelite 17 in windows.
Solution:
In Settings - Build - Tools under Makedir select the Path of mkdir.exe within in the Codelite folder (surrounded by " -quotes).
Although context help says to leave it empty in order to use the OS' own mkdir, Windows' mkdir is quite different to the mkdir of other *ix-like OS.
Furthermore for me it was necessary to explicitly add -p
There is a hint in Codelite's change dokumentation in the recent monthly build 17.1 that it solves this problem as a bugfix.

Related

Build a QT program from command line

I know this question has already been asked, but I encounter an issue that I haven't seen elsewhere.
I am trying to build automatically a QT program on Jenkins through a JenkinsFile.
So I want to build this program in command line.
On Qt Creator, everything works fine, my makefile is generated and the program compiles.
But when I manually type the exact commands that are executed in Qt on a terminal (cmd and cygwin), the compilation fails.
The errors are usually ld: cannot find -lXXXXXX
My guess is that it is an environment problem so I tried to add some lib paths in the $PATH, $LIBRARY_PATH, and $LD_LIBRARY_PATH variables but it doesn't resolve the problem. The error just becomes Undefined reference to ___XXXXXX
I would appreciate some help on this issue !
Thanks.
EDIT
The building (slave) machine is a windows 7. Here is a screenshot of the compilation stage in Qt (which works fine). The commands I try to type in a terminal are exactly the same as the blue lines on the screenshot. (sorry some lines are written in French)
From the error message ld: cannot find -lXXXXXX and the environment variables, I would suppose that you are compiling in Linux/Unix. Now, if you are compiling with g++, the environment variables $PATH, $LIBRARY_PATH, and $LD_LIBRARY_PATH won't have any effect on finding libraries. What you may try is an -L argument to the compiler telling it where the library is located, I mean:
g++ -L /path/to/libXXXXX.so -l XXXXX -o result source.cpp

Why my codelite execute 'make -j 0'

I'm using cmake-GUI on windows, generating for codelite, to build a simple "hello world" project (https://github.com/jameskbride/cmake-hello-world). I'm trying to use cygwin compilers but when I run the build command, I got the following error:
C:\WINDOWS\system32\cmd.exe /C C:/cygwin64/bin/make.exe -j 0
----------Building project:[ Debugging - Debug ]----------
make: the '-j' option requires a positive integer argument
Usage: make [options] [target] ...
Why it is happening?!?
My cygwin folder is in PATH. In cygwin terminal the project works.
Your project was generated by CMake - this means that the project is set to custom project so the command to execute (in your case make -j0) is set in the Project Settings->Customize->Custom build page.
On that page you have several entries with different titles (Build, Clean etc)
Double click each entry so it will open in Edit mode and remove the -j0 option
This looks like a bug in CodeLite - CMake generator

QtCreator cannot find stddef.h working on linux

I just freshly installed Qt Creator 4.1.0
Based on Qt 5.7.0 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit)
This error drives me crazy after I fixed all kit errors, actually I spent some time on google looking for proper compiler. This could be something with compiler version I think:
/usr/include/c++/5.3.1/cstddef:45: error: stddef.h: No such file or
directory
I saw solutions for windows everywhere but could not find for linux, does anyone has experience how to fix it?
Screenshots
rpm -qa | grep devel | sort
expat-devel-2.1.0-10.fc22.x86_64
fontconfig-devel-2.11.94-4.fc22.x86_64
freetype-devel-2.5.5-2.fc22.x86_64
gdbm-devel-1.11-4.fc22.x86_64
glibc-devel-2.21-13.fc22.i686
glibc-devel-2.21-13.fc22.x86_64
java-1.8.0-openjdk-devel-1.8.0.65-3.b17.fc22.x86_64
kernel-debug-devel-4.2.5-201.fc22.x86_64
kernel-debug-devel-4.2.6-200.fc22.x86_64
kernel-devel-4.2.6-200.fc22.x86_64
libdb-devel-5.3.28-12.fc22.x86_64
libdrm-devel-2.4.61-3.fc22.x86_64
libICE-devel-1.0.9-2.fc22.x86_64
libpng-devel-1.6.16-3.fc22.x86_64
libSM-devel-1.2.2-2.fc22.x86_64
libstdc++-devel-5.3.1-6.fc22.i686
libstdc++-devel-5.3.1-6.fc22.x86_64
libXau-devel-1.0.8-4.fc22.x86_64
libxcb-devel-1.11-8.fc22.x86_64
libXcursor-devel-1.1.14-4.fc22.x86_64
libXdamage-devel-1.1.4-6.fc22.x86_64
libXext-devel-1.3.3-2.fc22.x86_64
libXfixes-devel-5.0.1-4.fc22.x86_64
libXft-devel-2.3.2-2.fc22.x86_64
libXi-devel-1.7.4-2.fc22.x86_64
libXinerama-devel-1.1.3-4.fc22.x86_64
libXrandr-devel-1.4.2-2.fc22.x86_64
libXrender-devel-0.9.9-1.fc22.x86_64
libxshmfence-devel-1.2-1.fc22.x86_64
libXt-devel-1.1.4-10.fc22.x86_64
libXv-devel-1.0.10-2.fc22.x86_64
libXxf86vm-devel-1.1.4-1.fc22.x86_64
libX11-devel-1.6.3-1.fc22.x86_64
mesa-libGL-devel-10.6.9-1.20151008.fc22.x86_64
mesa-libGLU-devel-9.0.0-7.fc22.x86_64
perl-devel-5.20.3-328.fc22.x86_64
python3-devel-3.4.2-6.fc22.x86_64
qt-devel-4.8.7-4.fc22.x86_64
systemtap-devel-2.9-1.fc22.x86_64
systemtap-sdt-devel-2.9-1.fc22.x86_64
xorg-x11-proto-devel-7.7-12.fc21.noarch
zlib-devel-1.2.8-7.fc22.x86_64
I had this problem as well, and for me I had to disable ClangCodeModel plugin. To do this, I went to Help->About Plugins...->Uncheck ClangCodeModel (under C++ category). After restarting QT Creator, everything was working fine. I found this solution on QT Forums
If the compiler works from a terminal, it should work from QtCreator. So first make it work from the terminal.
From a terminal, create a file main.cpp with:
#include <cstddef>
int main()
{
return 0;
}
Then type the command:
gcc -H main.cpp -o main
If the compilation works, there must be a problem in your kit definition in QtCreator. Possibly make sure the folder where stddef.h is in the include file list of your kit. But you should not need to do that. Temporarily, you can add the include path to your project (see How to add include path in Qt Creator?) to check this is really the problem. Then you'll need to find a way to fix the kit for good.
If the compilation does not work, fix your environment (possibly using sashoalm's commented link). QtCreator is just and IDE, if you run it with a broken compiler it won't fix it for you. The compilation output will show where files (cstddef and then stddef.h) are picked from (-H option). Try cpp -v to see where included files are searched.
On my machine, compilation output gives me:
. /usr/include/c++/4.8/cstddef ..
/usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h ...
/usr/include/x86_64-linux-gnu/c++/4.8/bits/os_defines.h ....
/usr/include/features.h .....
/usr/include/x86_64-linux-gnu/sys/cdefs.h ......
/usr/include/x86_64-linux-gnu/bits/wordsize.h .....
/usr/include/x86_64-linux-gnu/gnu/stubs.h ......
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h ...
/usr/include/x86_64-linux-gnu/c++/4.8/bits/cpu_defines.h ..
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h Multiple include
guards may be useful for: /usr/include/c++/4.8/cstddef
/usr/include/x86_64-linux-gnu/bits/wordsize.h
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h
/usr/include/x86_64-linux-gnu/gnu/stubs.h
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h
see stddef.h was found in /usr/lib/gcc/x86_64-linux-gnu/4.8/include
And cpp -v gives:
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
Note: If you created the kit manually, I would recommend that you uninstall QtCreator. Make gcc work from a terminal and then reinstall QtCreator. This one should create the kits automatically and they should then work.
This is a common problem with QT I experience a lot with all versions of Fedora, the problem is that the path to "/usr/lib64/qt5/bin" is missing from the user environment.
To check for the path at a command line what the path is present set to enter the following: echo $PATH
You should see the "/usr/lib64/qt5/bin" listed somewhere in the response if it is not present then edit the .bashrc file in the root of your home directory as follows: -
Add QT5 build environment
if! [[ "$PATH" =~ "/usr/lib64/qt5/bin" ]]
then
PATH="/usr/lib64/qt5/bin:$PATH"
fi
Just above the "export PATH" statement
You will need to log off and on again for the changes to take effect.

CodeLite error while compiling library project

Im trying to compile static library project with CodeLite and getting error:
ar rcus ./Debug/libtestlib.a #"testlib.txt"
ar: #testlib.txt: No such file or directory
But i have file testlib.txt. When i inspect exported makefile i see:
$(AR) $(ArchiveOutputSwitch)$(OutputFile) #$(ObjectsFileList) $(ArLibs)
For me it is strange to see there # symbol near ObjectsFileList. How should i compile static library project in CodeLite ?
The #"testlib.txt" is a way of letting the linker (or ar in your case) to read the object list from a file and not from a command line, this is done because on some OS, there is a limitation on the input string that a program can accept from the command line.
Usually this is not a problem ( you did not mention what is your OS and CodeLite version ) but if it is a problem (like in your case), you can disable this from CodeLite's menu bar:
Settings -> Build Settings -> Compilers -> <Your Compiler Name> -> Advanced
and Uncheck the option:
"Pass object list to the linker via file" and your problems will be gone
FYI:
I only seen this error on OSX, is this the case here?
Eran

netbeans, Qt, & Qmake "command not found"

All,
I am (trying to) using Netbeans to build a simple Qt app (from a tutorial) and I cannot build it because I get this error:
/C/Qt/2010.02.1/qt/qmake/qmake.exe VPATH=. -spec win32-g++ -o qttmp-Debug.mk nbproject/qt-Debug.pro
make[1]:/C/Qt/2010.02.1/qt/qmake/qmake.exe: Command not found
when the file is exactly there, and I can open a terminal and execute it.
Note in the error message: "/C/Qt..." The actual path is C:/Qt...
I have used the tools/options/c++ dialog to browse to the file and select it, and it is specified as C:\Qt... just like all the other tools. What is corrupting the C: and making it /C/ ?
Now, if I remove the path to qmake, and have it use the PATH environment variable, it finds it, but then it fails due to 'multiple targets'...
Obviously, pilot error, but where? I have seen several posts on this, and they all say to make sure it is in the path, and it is, so now what? (I can open a terminal and type 'qmake' and I get the 'Usage: qmake..." so I know it is visible.
Windows 7, Netbeans 7.0, MinGW (I also have cygwin installed...).
Any and all help greatly appreciated.
:bp:
Addenda: I changed the path to my 'make' to use the MinGW one rather than the cygqin one, and now it can find qmake, but I get other errors: 'Could not find mkspecs for your QMAKESPEC(win32-g++) after trying:...
Any additional thoughts?
QMake requires more than just a path to work correctly. On my Windows box, there is a menu option for 'Qt Command Prompt' under the 'Qt SDK 2010.05' group in the Start Menu. Running it produces the following:
Setting up a MinGW/Qt only environment...
-- QTDIR set to C:\Qt\2010.05\qt
-- PATH set to C:\Qt\2010.05\qt\bin
-- Adding C:\Qt\2010.05\bin to PATH
-- Adding C:\WINDOWS\System32 to PATH
-- QMAKESPEC set to win32-g++
You will want to make sure the environment you launch qmake in has all of those set.
The most probable reason you are see '/C/...' is because you are causing a mingw shell to run when you execute your build.

Resources