I have been dividing some working code into multiple files in accord with a previous thread on C++ exception handling in a multithreaded application. In particular, I have a single class whose implementation is split into two .cpp files -- one that can throw exceptions and one that cannot. The two files have slightly different compiler options: first file has --exceptions and the second has -o2 (optimization; the same thing happens with -o0 and -o1 FWIW). This gives me two problems.
First, when I compile one of the files that was split up I get several similar messages to these:
"[...]/stl/_alloc.h", line 131: Warning - INLINE recursion limit exceeded.
"[...]/stl/_uninitialized.h", line 120: Warning - INLINE recursion limit exceeded.
The same things pop up repeatedly when linking (presumably because of the late template instantiation as described in the TI wiki article on that topic). I can get this to go away by doing any of these things:
- Enable --exceptions on second file even though it doesn't (and must not!) throw exceptions.
- Turn off optimization (-o2) on the second file.
- Copy-and-paste the one file in toto at the botom of the other and put -o2 and --exceptions on that file.
The second is the least bad of these options, but I would prefer to have at least function inlining enabled for the sake of my STL functions.
Irrespective of whether these warning show up or not, I also get a perplexingly vague linker error:
>> error: Must link using shell to complete template instantiations
I have opened a command prompt and tried linking from there, both using the .lkf file and invoking the linker with all the .lkf's params directly, but I get the same error. In both cases I am invoking cl67x.exe, not lnk6x.exe. Help!
I am using CCS 3.1 and cgtools 5.1.12.