How to fix this gnu issue this is my output - g++

[Running] cd "c:\Users\dead\Documents\vs code\C++" && g++ new -o c:\Users\dead\Documents\vs code\C++\new && "c:\Users\dead\Documents\vs code\C++"c:\Users\dead\Documents\vs code\C++\new
g++: error: code\C++\new: No such file or directory
[Done] exited with code=1 in 0.455 seconds

I assume you are using Code Runner.
In your output, you are trying to build a file called new, this is not acceptable by g++, you should change its name with .cpp or .cxx end.

Related

Making Cmakelist (ros) failure

After installing ros(melodic version), I followed the below steps one by one.
$ mkdir -p catkin_ws/src
$ cd catkin_ws/src
$ catkin_init_workspace
$ cd ..
$ catkin_make
Then error came up like this
CMake Error at CMakeLists.txt:1:
Parse error. Expected a command name, got unquoted argument with text
"/opt/ros/melodic/share/catkin/cmake/toplevel.cmake".
-- Configuring incomplete, errors occurred!
See also "/home/hangilkim/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/hangilkim/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I found that CMakeLists.txt file in 'home/catkin_ws/src' folder exists clearly, but contain only this message.
/opt/ros/melodic/share/catkin/cmake/toplevel.cmake
How can I solve this problem??
Looks like you are trying to compile an already compiled project. So delete the CMakeLists.txt file in 'home/catkin_ws/src' or for safety measures move it to another folder then run catkin_make command on your terminal.

Installing LLReve using Cmake. Unknown BISON_TARGET error

I am getting the following error :
CMake Error at CMakeLists.txt:9 (BISON_TARGET):
Unknown CMake command "BISON_TARGET".
when I run the command :
cmake .. -GNinja
Please tell me what to do. I tried searching on google a lot and thus came up with the additions and finally ran the command :
cmake .. -D LLVM_DIR=/usr/lib/llvm-5.0/cmake/ -D FLEX_EXECUTABLE=/usr/local/Cellar/flex/2.5.37/bin/ -D FLEX_INCLUDE_DIR=/usr/local/Cellar/flex/2.5.37/include/ -D BISON_EXECUTABLE=/usr/bin/bison
but it still shows the same error :(.
Please someone help.
Your error is occurring because the BISON_TARGET function definition has not yet been supplied. This method, as commented, is supplied by FindBISON. The error indicates that either Bison was not found on your system (hopefully, you have it installed), or cmake was ran from the wrong directory. Bison is included in the top-level CMake file via:
find_package(BISON REQUIRED)
This line to include Bison must be called before using the BISON_TARGET CMake function. The LLReve instructions for compiling this repository are explicit about which directory to run the build commands in:
Go to the llreve directory and run
cd reve
mkdir build
cd build
cmake .. -GNinja
ninja
This would run on the CMake file in the llreve/reve directory, not the llreve/reve/reve directory. Please ensure you are running CMake from the correct location, as not running cmake on the top-level CMake file will often yield errors.

Simple test output - CMake Error: The source directory does not exist

When I create new project in Clion, cmake cannot find CMakeTmp directory.
Run Build Command(s):/usr/bin/cmake cmTC_df723/fast && No such file or directory
OS: Linux Mint 19 (Ubuntu based)
I have tried:
reinstalling gcc (now on version 8.3.0)
reinstalling cmake (now on version 3.15.2)
unset TMP from (CMake cannot compile test program as source directory doesnt exist)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_SYSTEM_NAME Linux)
checked permissions to ClionProject subdirectories
Error output:
/usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/bin/cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/gcc -G "CodeBlocks - Unix Makefiles" /home/sacha/CLionProjects/testProject
-- The C compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/gcc
CMake Error: Generator: execution of make failed. Make command was: /usr/bin/cmake cmTC_df723/fast &&
-- Check for working C compiler: /usr/bin/gcc -- broken
CMake Error at /usr/local/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/usr/bin/gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/sacha/CLionProjects/testProject/cmake-build-release-system/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/cmake cmTC_df723/fast && No such file or directory
Generator: execution of make failed. Make command was: /usr/bin/cmake cmTC_df723/fast &&
Any help or directions appreciated, thanks!
The error message
CMake Error: Generator: execution of make failed.
signals, that something wrong with CMake settings or its generator.
In the given case you have additional message
Make command was: /usr/bin/cmake cmTC_df723/fast &&
which means that cmake is run as a Make command.
This is wrong: cmake and make commands are not interchangeable.
Would you inspect the very first command line, you will find the source of that problem:
-DCMAKE_MAKE_PROGRAM=/usr/bin/cmake
Exactly it sets cmake executable for Make command. You need to fix that line (e.g. in CLion settings).

Scons "Dir" command doesn't work?

I've got a sub directory called "myc" containing 2 ".c" files:
$ ls myc
1.c f.c
And my current directory has a SConstruct:
$ cat SConstruct
myc=Dir('myc')
print myc
Program('test2',myc)
Run scons, it prints a bunch of errors:
$ scons
scons: Reading SConscript files ...
myc
scons: done reading SConscript files.
scons: Building targets ...
gcc -o test2 myc
/usr/bin/ld: cannot find myc: File format not recognized
collect2: error: ld returned 1 exit status
scons: *** [test2] Error 1
scons: building terminated because of errors.
What is weird: I expect the "print myc" will list "1.c" and "f.c", to my disappointment it prints "myc", not the varible value, and the compiling also fails.
How to correct it?
Not sure why you believe that specifying a directory as the source(s) for a directory would work?
Is there something in the docs which makes you believe this should work?
If so, please point it out so it can be improved.
If you did:
gcc -o blah some_dir_name
That wouldn't work right?
This should do what you're asking for.
myc=Glob('myc/*.c')
print myc
Program('test2',myc)

g++.exe: #letstr.txt: No such file or directory g++.exe: no input files -first try-

as you know that i'm really a beginner for CodeLite and MinGW, and i don't have any idea how it's works. When i try to build the project, the output said that it's error and i don't know what should i do. I'm using Windows 10.
i simply just follow the steps based on this video for the first try. https://www.youtube.com/watch?v=LGGHxaDxSK4
when i want to apply for some installation, the bar always show up like this
http://sta.sh/015gez4rfjn0
i even try to mark mingw32-gcc-g++
let me show you my output
C:\Windows\system32\cmd.exe /C C:/MinGW/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f Makefile
"----------Building project:[ letstr - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/asu/Documents/letstry/letstr'
C:/MinGW/bin/g++.exe -o ./Debug/letstr #"letstr.txt" -L.
g++.exe: #letstr.txt: No such file or directory
g++.exe: no input files
mingw32-make.exe[1]: *** [Debug/letstr] Error 1
letstr.mk:78: recipe for target 'Debug/letstr' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/asu/Documents/letstry/letstr'
Makefile:4: recipe for target 'All' failed
mingw32-make.exe: *** [All] Error 2
====1 errors, 0 warnings====
g++.exe: #letstr.txt: No such file or directory
i think your destination file incorrect. if you create C program it must be named with .c extension instead of .txt.