Are files in the same directory as a file being compiled automaticallyfound by a standard following

  • Thread starter Asfand Yar Qazi
  • Start date
A

Asfand Yar Qazi

Hi,

Here's the thing: the Eternity persistence system does not
provide its own compilation phase for its source code: the
programmer simply has to copy some files to his codebase.

Here's the thing though: the author has a .cpp in the "src"
directory that contains the other .cpp files, "eternity.cpp",
which basically contains:

#include "dynamic.cpp"
#include "persist.cpp"
#include "persist_xml.cpp"
#include "xmlscanner.cpp"

The directory hierarchy of the package is something like this:

$ ls
include/ src/ doc/ test/ examples/ etc...

Thing is though, in the 'example' directory ("cd examples"), it
gets compiled by GCC like this:

g++ -c -I../include ../src/eternity.cpp

The 'dynamic.cpp' etc. files are all picked up automatically
without specifying a '-I' argument. Is this standard behaviour?

Thanks,
Asfand Yar
 
M

Mike Wahler

Thing is though, in the 'example' directory ("cd examples"), it
gets compiled by GCC like this:

g++ -c -I../include ../src/eternity.cpp

The 'dynamic.cpp' etc. files are all picked up automatically
without specifying a '-I' argument. Is this standard behaviour?

The language standard has absolutely nothing to say about where
and how source files are located by your compiler. Each one is
free to do it in whatever way it wants. Read your compiler documentation,
and/or ask about this in a newsgroup that discusses it.

-Mike
 
A

Asfand Yar Qazi

Mike said:
The language standard has absolutely nothing to say about where
and how source files are located by your compiler. Each one is
free to do it in whatever way it wants. Read your compiler documentation,
and/or ask about this in a newsgroup that discusses it.

-Mike

Actually, I remember somebody somewhere saying this was standard
C++ behaviour, which I was checking up on. Therefore it is a
relavent question. However, you answered it, so thanks.
 
B

Bill Seurer

Actually, I remember somebody somewhere saying this was standard C++
behaviour

Actually, the standard doesn't even require that there be actual header
"files".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top