incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: Intel C++ build issues on Windows
Date Wed, 18 Jul 2007 04:46:36 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [] 
>> Sent: Monday, July 09, 2007 9:54 PM
>> To:
>> Subject: Re: Intel C++ build issues on Windows
>>>   I can make the function i.e. init_example() in which all needed 
>>> hooks are installed, but this function should be invoked 
>> from main() 
>>> in all examples.
>> I was hoping to do it in a non-intrusive way. For instance, 
>> on UNIX we could link with (or preload) a shared library that 
>> would in its startup code run the function. Or we could use a 
>> command line option to the preprocessor (such as gcc -include 
>> <file>) to include a header containing the definition of such 
>> a function:
>> ns.html#index-include-634
>> Does MSVC have something similar?
>   Yes. The MSVC have /FI option:
> -------
> Causes the preprocessor to process the specified header file.

That's good. Now we just need to look to see if all the other
compilers support something like it. Unfortunately, the first
two I looked at don't seem to have anything resembling it.

Sun C++:

So it looks like we need something different.

One possibility might be to create a copy of a standard file,
say <cstddef>, in examples/include and have it do what examples.h
does now in addition to #including the real <cstddef>. And of
course, we'd have to remember to explicitly #include <cstddef>
in every example to make it work.

Another option is to rig one of the library headers (e.g.,
_config.h) to optionally #include some header that we could
then "insert" by defining the right magic macro. Like this:

   // _defs.h

then we'de compile our examples with the following option on
the command line:

Neither of these is very pretty but we have a feature request
for something pretty close to the second one:

(We could do what Markus suggested with examples.h and have
the header #include config.h at the top.)



> /FI[ ]pathname
> Remarks
> This option has the same effect as specifying the file with double
> quotation marks in an #include directive on the first line of every
> source file specified on the command line, in the CL environment
> variable, or in a command file. If you use multiple /FI options, files
> are included in the order they are processed by CL.
> -------
> Farid.

View raw message