Author Topic: The program cannot be compiled in Linux  (Read 873 times)

Offline tumanovalex

  • Multiple posting newcomer
  • *
  • Posts: 23
The program cannot be compiled in Linux
« on: February 08, 2024, 12:14:01 pm »
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;
}
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))
This program compiles without errors in Windows Code Blocks. I attached the project and the test directory. Please help me.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1563
Re: The program cannot be compiled in Linux
« Reply #1 on: February 08, 2024, 02:01:13 pm »
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

Offline tumanovalex

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: The program cannot be compiled in Linux
« Reply #2 on: February 08, 2024, 04:42:32 pm »
Thank you very much! I changed the terminal and everything worked.