> and my source file is in the same folder as boost.
This is a mistake - don't put your code in the same place as third-party libraries.
In essence, you should have
gcc -I/path/to/boost prog.c
Where /path/to/boost is the top-level directory of where your boost header files are installed (say /usr/include/boost)
If you're using some IDE, then how you configure compiler search paths depends on that IDE.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
> Is this bad practice or simply illegal? How/why should it affect anything?
It's just bad practice.
If the library gets updated, and it just happens to use the same filename as one you've chosen, it's bye bye code for you.
Also, anyone else trying to use the same library code (or even you on another project) risk picking up unintended files.
Plus when source is distributed, it always exists in separate directory structures.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953