News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Program works alone but not as a project

Started by neo2264, January 26, 2014, 03:43:00 AM

Previous topic - Next topic

neo2264

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.


neo2264

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.

oBFusCATed

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!]