<div class="gmail_quote">[Please answer to whole list]<br><br>Sorry, I am not a windows developer. I just told what I am able to remember, and to point out that it is not a VTK specific error. You should try to post your problem on a MS Windows dev forum, if anybody else give you the solution.<br>
<br>Sorry again !<br>Jerome<br><br><br><br>2009/8/17 salih halil sonmez <span dir="ltr">&lt;<a href="mailto:salihhalilsonmez@gmail.com">salihhalilsonmez@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
it does not solve the problem. Which header should I include in pre-compiled header_?<br><br><div class="gmail_quote">2009/8/17 Jérôme <span dir="ltr">&lt;<a href="mailto:jerome.velut@gmail.com" target="_blank">jerome.velut@gmail.com</a>&gt;</span><div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>As far as I know, stdafx is an include file that defines pre-compiled header for ms windows applications. Hum, maybe &quot;PCH&quot; means &quot;pre-compiled header&quot;. Your error message indicates error at line 1 where you have comment character. This is weird. It seems that you have to include files in a order that has its importance. Maybe you can try to include &quot;stdafx.h&quot; first ? <br>


<br>Good luck<br>Jerome<br><br><div class="gmail_quote">2009/8/17 salih halil sonmez <span dir="ltr">&lt;<a href="mailto:salihhalilsonmez@gmail.com" target="_blank">salihhalilsonmez@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><div></div><div>
hi everyone;<br>I am trying to compile simple vtk samples. Then, I faced with error like:<br><br>Error    1    fatal error C1189: #error :  include &#39;stdafx.h&#39; before including this file for PCH <br><br>How can I deal with this problem? can anyone help?<br>



<br>Here is the sample code:<br>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>



//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>#include &quot;vtkSDI.h&quot;<br>



<br>#include &quot;vtkSDIDoc.h&quot;<br>#include &quot;vtkSDIView.h&quot;<br><br>#include &quot;vtkCallbackCommand.h&quot;<br>#include &quot;stdafx.h&quot;<br>#ifdef _DEBUG<br>#define new DEBUG_NEW<br>#endif<br><br><br>// CvtkSDIView<br>



<br>IMPLEMENT_DYNCREATE(CvtkSDIView, CView)<br><br>BEGIN_MESSAGE_MAP(CvtkSDIView, CView)<br>  // Standard printing commands<br>  ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)<br>  ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)<br>



  ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)<br>  ON_WM_CREATE()<br>  ON_WM_DESTROY()<br>  ON_WM_ERASEBKGND()<br>  ON_WM_SIZE()<br>END_MESSAGE_MAP()<br><br>// CvtkSDIView construction/destruction<br><br>



CvtkSDIView::CvtkSDIView()<br>{<br>  this-&gt;pvtkMFCWindow     = NULL;<br><br>  // Create the the renderer, window and interactor objects.<br>  this-&gt;pvtkRenderer    = vtkRenderer::New();<br>}<br><br>CvtkSDIView::~CvtkSDIView()<br>



{<br>  // delete generic vtk window<br>  if (this-&gt;pvtkMFCWindow) delete this-&gt;pvtkMFCWindow;<br>}<br><br>void CvtkSDIView::OnDraw(CDC* pDC)<br>{<br>  CvtkSDIDoc* pDoc = GetDocument();<br>  ASSERT_VALID(pDoc);<br><br>



  if (this-&gt;pvtkMFCWindow)<br>  {<br>    if (pDC-&gt;IsPrinting())<br>      this-&gt;pvtkMFCWindow-&gt;DrawDC(pDC);<br>  }<br>}<br><br><br>// CvtkSDIView printing<br><br>BOOL CvtkSDIView::OnPreparePrinting(CPrintInfo* pInfo)<br>



{<br>  // default preparation<br>  return DoPreparePrinting(pInfo);<br>}<br><br>void CvtkSDIView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)<br>{<br>  // TODO: add extra initialization before printing<br>}<br><br>



void CvtkSDIView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)<br>{<br>  // TODO: add cleanup after printing<br>}<br><br><br>// CvtkSDIView diagnostics<br><br>#ifdef _DEBUG<br>void CvtkSDIView::AssertValid() const<br>



{<br>  CView::AssertValid();<br>}<br><br>void CvtkSDIView::Dump(CDumpContext&amp; dc) const<br>{<br>  CView::Dump(dc);<br>}<br><br>CvtkSDIDoc* CvtkSDIView::GetDocument() const // non-debug version is inline<br>{<br>  ASSERT(m_pDocument-&gt;IsKindOf(RUNTIME_CLASS(CvtkSDIDoc)));<br>



  return (CvtkSDIDoc*)m_pDocument;<br>}<br>#endif //_DEBUG<br><br><br>// CvtkSDIView message handlers<br><br>int CvtkSDIView::OnCreate(LPCREATESTRUCT lpCreateStruct)<br>{<br>  if (CView::OnCreate(lpCreateStruct) == -1)<br>



    return -1;<br><br>  return 0;<br>}<br><br>void CvtkSDIView::OnDestroy()<br>{<br>  // Delete the the renderer, window and interactor objects.<br>  if (this-&gt;pvtkRenderer)      this-&gt;pvtkRenderer-&gt;Delete();<br>



<br>  // destroy base<br>  CView::OnDestroy();<br>}<br><br>BOOL CvtkSDIView::OnEraseBkgnd(CDC* pDC)<br>{<br>  return TRUE;<br>}<br><br>void CvtkSDIView::OnSize(UINT nType, int cx, int cy)<br>{<br>  CView::OnSize(nType, cx, cy);<br>



<br>  if (this-&gt;pvtkMFCWindow)<br>    this-&gt;pvtkMFCWindow-&gt;MoveWindow(0, 0, cx, cy);<br>}<br><br>static void handle_double_click(vtkObject* obj, unsigned long,<br>                                void*, void*)<br>



{<br>  vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::SafeDownCast(obj);<br>  if(iren &amp;&amp; iren-&gt;GetRepeatCount())<br>    {<br>    AfxMessageBox(&quot;Double Click&quot;);<br>    }<br>}<br><br>void CvtkSDIView::OnInitialUpdate()<br>



{<br>  CView::OnInitialUpdate();<br><br>  if (this-&gt;pvtkMFCWindow) delete this-&gt;pvtkMFCWindow;<br>  this-&gt;pvtkMFCWindow = new vtkMFCWindow(this);<br><br>  this-&gt;pvtkMFCWindow-&gt;GetRenderWindow()-&gt;AddRenderer(this-&gt;pvtkRenderer);<br>



  <br>  // get double click events<br>  vtkCallbackCommand* callback = vtkCallbackCommand::New();<br>  callback-&gt;SetCallback(handle_double_click);<br>  this-&gt;pvtkMFCWindow-&gt;GetInteractor()-&gt;AddObserver(vtkCommand::LeftButtonPressEvent, callback, 1.0);<br>



  callback-&gt;Delete();<br><br>}<br>-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>


\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<br>
 <br>So, How can I deal with this problem? can anyone help?<br>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>
</blockquote></div></div></div><br>
</blockquote></div><br>