Arturo
Arturo

Reputation: 29

Problems with GCC "build file: no target in no project"

I have a problem with C. When I want to compile my sources codes, I see the message:

=== Build file: "no target" in "no project" (compiler: unknown) ===

The classic Hello world works, but I have this message.

enter image description here

I want to make a program that read all absolute directories and subdirectories recursively, print all names with 252 characters or more in a file. I use codeblocks and GNU gcc.

enter image description here

Upvotes: 2

Views: 58486

Answers (6)

Mladen Janjic
Mladen Janjic

Reputation: 117

I've seen on many forums that users still get message "no target" in "no project" even though only one C or CPP file is open.

My case was the same, but for half an hour I didn't read the rest of error messages below the mentioned one, thinking that there is a configuration issue and thinking to solve other errors later. But there was only ONE problem that caused everything: the code example had "smart" quotation marks for strings instead of ordinary ones, just like code examples on this page: https://pwskills.com/blog/c-programming-examples/

After fixing quotation marks, the compilation works without problems. So, check all other error messages and warnings, since the first one may seem to be caused by configuration issues, but in fact it may be shown as a result of compilation failure caused by some error in the code.

Upvotes: 0

Vityata
Vityata

Reputation: 43593

I have just had this problem with Codeblocks. Although I had a compiler.

The problem was that I have not saved the file with the correct extension - e.g. it was Untitled4 instead of Untitled4.c or Untitled4.cpp (for c++). Simply renaming the file has worked.

Upvotes: 4

Mostafa Na
Mostafa Na

Reputation: 1

Just create a new project and Copy and paste your texts into the new files. It will work.

Upvotes: 0

Murilo Fujita
Murilo Fujita

Reputation: 1

While the process is active, you can´t run the program.
Open the Task Manager and kill the process created by CodeBlocks (the same name of your project).

Upvotes: 0

Gaurav Sahu
Gaurav Sahu

Reputation: 1

I have encountered the same problem. So i found that i do have created a project file, but my files(.cpp, .h and other) files were not included in my project, to check that open your codeblock ide-> open your project-> and on the left hand side you will see a Management tab, which should contain all your file( if you are not able to see Management tab, just follow step: go to view panel )

Upvotes: 0

Laura
Laura

Reputation: 1

I just had this problem too but I managed to get it going. I had to go to New --> Project --> Console Application.

My guess is that an update has changed functionality or something. I distinctly remember that I could just simply add a new Empty File and then be able to debug and it run from there. Apparently not anymore. I now specifically have to go to the add new projects option and then choose the console application.

Don't forget to choose the C compiler and not C++ compiler when it walks you through the process.

Upvotes: 0

Related Questions