CLion says 'Process finished with exit code 127'

gfdsal

So I am running a sample c code Hello World project that appears when you make a new c project:

main.c:

#include <stdio.h>

int main() {
    printf("Hello, World!\n");
    return 0;
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.15)
project(untitled1 C)
set(CMAKE_C_STANDARD 99) 
add_library(untitled1 library.c library.h main.c)

When I press Run, earlier it was giving me "error 12, permission denied" so I modified the file permissions. Now I am getting the following in the Run window:

/Users/alan/CLionProjects/untitled1/library.c

Process finished with exit code 127

I googled but cant seem to find any solution.

The following is the image of the preferences:

enter image description here enter image description here

Victor Sergienko

You are trying to run a library. Modifying file permissions by hand is not the way to make it work, you could as well try running an arbitrary random file.

In order to make an executable, you need to use add_executable.

What you are running is not called an object file. I recommend reading some introduction like this one.

Also, if you want to create a library and link against it, you need to describe it with add_library using library.c, and then an executable with add_executable using main.c. Then link the executable to the library with target_link_libraries. Here's a CMake tutorial that may help.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Clion : Process finished with exit code 139

Running Python from CLion gives "Processed finished with exit code 127"

CLion not debugging one of my targets - immediate `Process finished with exit code 0`

"Process finished with exit code 139" in CLion IDE while the program is running fine in the terminal

Process finished with exit code -1073741819 (0xC0000005) - C, CLion But There Is Nothing Wrong With the Output

cLion C++ "Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)"

Process finished with exit code 139

Spring Camel: Process finished with exit code 0

what is "Process finished with exit code 1" mean?

"Process finished with exit code 1602" python

PHPStorm - Process finished with exit code 255

WebStorm: NodeJS Process finished with exit code 0

Process finished with exit code 0 - whats wrong?

fseek Process finished with exit code 11

c++ process finished with exit code

Pycharm,Selenium Process finished with exit code zero

java 130 Process finished with exit code 130

Process finished with exit code 1 pycharm

It says Process Finished but there is no output

aapt finished with non zero exit value 127

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

django pycharm error : Process finished with exit code 1

Android Studio AVD - Emulator: Process finished with exit code 1

Process finished with exit code 1 Spring Boot Intellij

Process finished with exit code -1073741515 (0xC0000135)

"Process finished with exit code 0" but desired output is not shown

Android Studio Emulator and "Process finished with exit code 0"

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

What does "Process finished with exit code 1" mean?