1

I just switched to CodeLite for C++ development. I followed the QuickStart guide and created a simple console executable (g++), and when setting up a new project, you can choose the Build System, which offers the options

  • Default
  • CMake
  • GNU makefile onestep build
  • NMakefile for MSVC toolset

If I choose "CMake", and leave everything else the way it is, I get my usual hello world code in main.cpp. Now I want to build it. I execute CMake, which produces a makefile, and then execute "Build" (by pressing F7 or via the menu). That does not work:

C:\Windows\system32\cmd.exe /C cd "\\"C\Users\Username\Documents\CodeLite\WorkspaceName\cmake-build-Debug"\ProjectName" && C:/mingw/mingw64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e
"\\C\Users\Username\Documents\CodeLite\WorkspaceName\cmake-build-Debug\ProjectName"
CMD unterst_tzt keine UNC-Pfade als aktuelles Verzeichnis.
====0 errors, 0 warnings====

The last line says it does not support UNC paths. Not sure whether that's the problem, but anyway, nothing actually gets built.

However, if I simply open a command line in the cmake-build-Debug\ProjectName\ directory, I can execute "make" and my executable is built properly.

Now my question is: Why does CodeLite not build my project? This does not seem to work as intended. I did not change any settings and my project is a clean default, but yet, I have to build it manually.

If I simply choose "Default" instead of "CMake", it gets build, by the way.

RL-S
  • 734
  • 6
  • 21

1 Answers1

0

A path in UNC (universal naming convention) has \\ before the host name and then the drive, directory, ... letters.

The path "\\C\Users\Username\Documents\CodeLite\WorkspaceName\cmake-build-Debug\ProjectName" does not look like a proper (UNC or other) path. Was it written this way by the CodeLite build system or did you need to do this manuully?

The form "C:\Users\Username\Documents\CodeLite\WorkspaceName\cmake-build-Debug\ProjectName" (or "C:\Windows\Users\ ...") should work on your system.

alle_meije
  • 2,424
  • 1
  • 19
  • 40
  • A UNC path contains a share name, not a drive letter. Thus, after recognizing the quotation marks to be serving their conventional purpose of quoting their contents, the string `"\\C\Users\Username\Documents\CodeLite\WorkspaceName\cmake-build-Debug\ProjectName"` has exactly the form of a UNC path. I presume that the build system expects it to be consumed by something that interprets it differently, however, or else that the build environment is just misconfigured. – John Bollinger Aug 03 '20 at 13:01
  • I don't know then, but I have the same error when I try to combine CMake with CodeLite in Windows. In my case both are on an NFS store and it's a non-root installation (not in the registry). The project path seems to be the problem. – alle_meije Sep 21 '20 at 13:31
  • I do not disagree that the path is the problem. I simply observe that the path string presented in the question does have the form of a UNC path, even if it is one that is unlikely to actually exist. It does not mean the same thing as the alternative form you suggest (which indeed is probably the form needed). I'd account that a bug in CodeLite. – John Bollinger Sep 21 '20 at 13:49
  • It is a bug somewhere, but maybe in CMake or even MinGW32-make. I tried with CodeLite projects where I religiously used the drive letter notation not the share (`N:\programs\etc`) as the project path, and inside CMake's compiler test script (which called MinGW32-make) suddenly the '\\' notation popped up. That did not come from the workspace / project settings! – alle_meije Sep 24 '20 at 09:13