Re: [Boost-docs] using import - from two .qbk files

Subject: Re: [Boost-docs] using import - from two .qbk files
From: Joel de Guzman (joel_at_[hidden])
Date: 2007-08-13 14:09:59


John Maddock wrote:
> Paul A Bristow wrote:
>> I am struggling using import, and have had bizarre problems with the
>> name of the template in the imported file where changing the name
>> seems to make it work. I get a message like:
>>
>> I:/Boost-sandbox/math_toolkit/libs/example/error_handling_example.cpp:
>> error: Could not open input file.
>>
>> and yet in the example below, the link
>>
>> [@../../example/error_handling_example.cpp error_handling_example.cpp]
>>
>> finds the file OK, so am I right to be confident that
>>
>> [import ../../example/error_handling_example.cpp]
>>
>> is correct?
>
> I used
>
> [import ../example/error_handling_example.cpp]
>
> which works OK.
>
>> I have the same code (I believe) elsewhere in the docs, in a
>> different section,
>> and it works OK in the html.
>>
>> Any ideas what I am doing wrong?
>>
>> Is it wrong to import twice? Is it wrong to 'use' twice with
>> [error_handling_example]?
>
> You must only import once, then you can use the defined template
> [error_handling_example] as many times as needed.

Yep. It's a known problem. This is a reason why I asked for
imports to have a pragma once behavior (There will be an implicit
include guard. A qbk file will only be included once per scope).
The same should be true for imports. I'm working on this. The first
step is to give templates (and macros) proper scoping. This is the
backward compatibility breaking issue I raised sometime ago.

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

This archive was generated by hypermail 2.1.7 : 2017-11-11 08:50:40 UTC