Hi all,<br><br>I&#39;m having a problem with the vtk error macro, and was hoping someone could shed some light on the issue.<br><br>The relevant lines for this problem start on line 467 of vtkGetSet.h from the git head:<br>
<br>     vtkmsg &lt;&lt; &quot;ERROR: In &quot; __FILE__ &quot;, line &quot; &lt;&lt; __LINE__      \<br>            &lt;&lt; &quot;\n&quot; &lt;&lt; self-&gt;GetClassName() &lt;&lt; &quot; (&quot; &lt;&lt; self     \<br>
            &lt;&lt; &quot;): &quot;  x &lt;&lt; &quot;\n\n&quot;;                            \<br><br>If x is a std::string, the above fails to compile, but the following is fine:<br><br>     vtkmsg &lt;&lt; &quot;ERROR: In &quot; __FILE__ &quot;, line &quot; &lt;&lt; __LINE__      \<br>
            &lt;&lt; &quot;\n&quot; &lt;&lt; self-&gt;GetClassName() &lt;&lt; &quot; (&quot; &lt;&lt; self     \<br>            &lt;&lt; &quot;): &quot; &lt;&lt; x &lt;&lt; &quot;\n\n&quot;;                            \<br>
<br>Note the extra &lt;&lt; right before x.<br><br>I&#39;m doing this to debug a problem in the vtkGDCMImageReader I&#39;m having where images aren&#39;t being read in Java, but are read just fine in C++-- I think that there&#39;s a problem with string termination, but I don&#39;t know.  So, I want to add the filename to the debug message.<br>
<br>The lines in gdcm are:<br><br>  if( !reader.Read() )<br>    {<br>      //added more detail for those instances where you can&#39;t debug, like in java<br>      std::string theFilename(filename);<br>      std::string theError = &quot;ImageReader failed on file: &quot; + theFilename;<br>
      vtkErrorMacro( theError );<br>      return 0;<br>    }<br><br>and they were:<br><br>  if( !reader.Read() )<br>    {<br>      vtkErrorMacro( &quot;ImageReader failed&quot; );<br>      return 0;<br>    }<br><br>I don&#39;t want to change vtk at all, I want to use what exists.  I could just modify my version right now to make my error message work (or at least compile)-- but how should I use the warning/error macros to get more information out than just a pure const char*?  I tried to use theError.c_str(), but that also failed.  It also failed to compile if I just sent filename over directly, as in vtkErrorMacro(filename);<br>
<br>Thanks,<br>Mark<br><br>