User forums > Using Code::Blocks

The program cannot be compiled in Linux

(1/1)

tumanovalex:
Hello!
antiX (Debian) 32bit. When compiling the program:
--- Code: ---#include <iostream>
#include <filesystem>
#include <map>
#include <string>

using namespace std;

namespace fs = filesystem;

int main()
{
  setlocale(LC_ALL, "Russian");
  map <string, unsigned int> map_ext;
//  for (const fs::directory_entry& dir_entry : fs::recursive_directory_iterator("N:\\TestProgramExt\\"))
  for (const fs::directory_entry& dir_entry : fs::recursive_directory_iterator("//media//alex//SSD256//TestProgramExt"))
  {
    if (fs::is_regular_file(dir_entry))
    {
      string ext = fs::path(dir_entry).extension().string();
      ++map_ext[ext];
    }
  }
  for (auto&& [ext, num] : map_ext)
    std::cout << ext << "\t" << num << std::endl;
  std::cin.get();
  return 0;
}
--- End code ---
an error occurs:
--- Code: ---------------- Build: Debug in cbCppStudyLin (compiler: GNU GCC Compiler)---------------

Target is up to date.
Nothing to be done (all items are up-to-date).


-------------- Run: Debug in cbCppStudyLin (compiler: GNU GCC Compiler)---------------

Checking for existence: /home/alex/cppStudyLin/bin/Debug/cbCppStudy
Set variable: LD_LIBRARY_PATH=.:
Executing: xterm -T cbCppStudyLin -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=:. /home/alex/cppStudyLin/bin/Debug/cbCppStudy  (in /home/alex/cppStudyLin/.)
Process terminated with status -1 (0 minute(s), 0 second(s))

--- End code ---
This program compiles without errors in Windows Code Blocks. I attached the project and the test directory. Please help me.

Miguel Gimenez:
Do you have xterm and sh installed?

If you have other terminal, try configuring it in Settings -> Environment settings -> General settings -> Terminal to launch console programs

tumanovalex:
Thank you very much! I changed the terminal and everything worked.

Navigation

[0] Message Index

Go to full version