-2

I want to compile a file using Codeblocks.

This main file calls other C files. When I build and run it, I have several errors in my console.

First, I have this error: ===Build file: "no target" in "no project" (compiler unknown) ===. I think that error is because I'm not trying to run a project but a single file.

Second, I have many "undefined reference to 'name_of_a_function' " errors. And I do not know why because all the functions are defined in the other files.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
PNB
  • 75
  • 10

1 Answers1

0

You should create a project to compile the file.

A similar question in Code::Blocks user forums:

I don't have a project, just wonted to compile and debug a single file. Is there a way to accomplish this without creating a project?

and the answer:

Nope.

Btw, why don't you use simple cc command to compile the file just like this?

cc test.c -o test
Ho1
  • 1,239
  • 1
  • 11
  • 29