如何编译swig php c ++ dll

I'm trying to compile a c++ dll from the output of swig I'm getting a bunch of errors regarding the actual php src maybe I'm doing it wrong but i have even built the php on windows using configure and then nmake. I have tried using both php 5.4 and 5.3 here are my errors using visual studio 2008:

Error   3   error C2491: 'std::endl' : definition of dllimport function not allowed c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream   967 LTMC_Wrapped
Error   4   error C2491: 'std::endl' : definition of dllimport function not allowed c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream   976 LTMC_Wrapped
Error   5   error C2491: 'std::ends' : definition of dllimport function not allowed c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream   985 LTMC_Wrapped
Error   6   error C2491: 'std::ends' : definition of dllimport function not allowed c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream   993 LTMC_Wrapped
Error   7   error C2491: 'std::flush' : definition of dllimport function not allowed    c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream   1001    LTMC_Wrapped
Error   8   error C2491: 'std::flush' : definition of dllimport function not allowed    c:\program files (x86)\microsoft visual studio 9.0\vc\include\ostream   1009    LTMC_Wrapped
Error   9   error C2491: 'std::ws' : definition of dllimport function not allowed   c:\program files (x86)\microsoft visual studio 9.0\vc\include\istream   1068    LTMC_Wrapped
Error   10  error C2491: 'std::ws' : definition of dllimport function not allowed   c:\program files (x86)\microsoft visual studio 9.0\vc\include\istream   1103    LTMC_Wrapped

I have also tried both VS2005 and VS2008. If there are any tutorials on how to use the php source with visual studio would also be very helpful. Any help is greatly appreciated, THANKS.

Just change the project runtime library from Multi-thread DLL to Multi-thread