Author Topic: Program works alone but not as a project  (Read 3282 times)

Offline neo2264

  • Single posting newcomer
  • *
  • Posts: 2
Program works alone but not as a project
« on: January 26, 2014, 03:43:00 am »
I'm very, very new to Code::Blocks.  I have been able to successfully build and run a program that I downloaded, which is a ballistic solution generator that when run, outputs a list of x and y values showing the drop of a projectile at certain points in its trajectory.  However, when I add the source files and header file into a new project (for organization's sake, so I can just open the project instead of opening every file all the time), and try to run it, it fails to run, and down in the debug console it says something about M_PI being undeclared in every instance it is used in one of the source files; and I think M_PI is a math.h function/variable of some kind. Can anyone suggest what I might be missing or doing wrong to cause it to run fine as a collection of tabs, but not as a collection of files which are part of a project? The language of the program is C. I tried empty project first as the project type when I created the new project to add the files to, then I tried console application as the project type when prompted and selected C instead of C++ from the drop down menu. In both cases, it still had the same problem. Any help would be greatly appreciated.


Offline neo2264

  • Single posting newcomer
  • *
  • Posts: 2
Re: Program works alone but not as a project
« Reply #2 on: January 26, 2014, 06:58:28 pm »
Thanks for that link, I think I may just try to find a workaround since the actual problem here might be very obscure and hard to identify.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Program works alone but not as a project
« Reply #3 on: January 26, 2014, 07:23:29 pm »
No, your problem is pretty simple and almost all novices hit it.
Probably you're missing and include declaration somewhere.
Just copy-paste the error into your search engine and try to find the cause.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]