I'm using Code::Blocks on Linux, specifically Ubuntu 9.10.
Problem: My projects cannot find and use the files from other projects.
I have 2 projects: bStats and bStream. Both work and compile just fine within their own projects, and both have their files in the same place with the same structure (~ used simply for brevity):
~/lib/bSt*/bS*.h
~/lib/bSt*/bS*.cpp
Where the project files are located in:
~/projects/bSt*/
Using these include lines:
#include "bStat/bStat.h"
#include "bStream/bStream.h"
In each package the file is found, and works fine for the respective package. The problem I'm running into is when I actually try to use the package:
I get the following error
/home/muppetjones/Ubuntu One/projects/bStat/main.cpp||In function ‘int main()’:|
/home/muppetjones/Ubuntu One/projects/bStat/main.cpp|21|error: ‘bStream’ was not declared in this scope|
/home/muppetjones/Ubuntu One/projects/bStat/main.cpp|21|error: expected ‘;’ before ‘bs’|
||=== Build finished: 2 errors, 0 warnings ===|
I know this is not a C++ error -- it is project dependent, which tells me there is a problem calling code from different projects.
I have tried adding the class directory, the lib directory...everything I can think of and in all the places which seem appropriate, but nothing seems to work. Please help!
I tried a variety of path names. The only two which find the file are:
#include "/home/muppetjones/Ubuntu One/lib/bStat/bStat.h"
#include "/home/muppetjones/Ubuntu One/lib/bStream/bStream.h"
and
#include "bStat/bStat.h"
#include "bStream/bStream.h"
If you mean add the 'lib/' directory to the "search directories", I have done so both for the project and globally. Again, it works for the calling project just fine, i.e. calling "bStat/bStat.h" works fine in the bStat project, but refuses to work in the bStream and vice versa.
Update: I tried, just for the fun of it, using a single project and adding all of the files -- same issue, with a couple of clarifications: the order of includes counts.
#include "/home/muppetjones/Ubuntu One/lib/bStream/bStream.h"
#include "/home/muppetjones/Ubuntu One/lib/bStat/bStat.h"
causes
to scream about bStat. Reverse the include, and it throws a fit about bStream.
Apparently I can only include one custom file?