Author Topic: Can't compile new file in a project.  (Read 2479 times)

Raigeki

  • Guest
Can't compile new file in a project.
« on: September 25, 2014, 03:24:02 am »
When in a project, I can only compile the main.cpp file. I added a new file to write a new program but the compiler it won't compile it.

Do I have to make a new project for every new program I write? If that is the case, what is the point of adding .cpp files to an existing project?

I'm sorta new, so help me out here  ;D

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Can't compile new file in a project.
« Reply #1 on: September 25, 2014, 05:07:14 am »
Is it a true multi file project?

If yes, at most one of the source files will have a main function in it.

If they both have main functions; then each of the files must be in a separate CB target.

Tim S.


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org