如何编译swig php c ++ dll

时间:2012-06-12 19:13:45

标签: php c++ windows visual-c++ swig

我正在尝试从swig的输出编译一个c ++ dll我得到一堆关于实际的php src的错误也许我做错了但我甚至在windows上使用configure构建了php然后NMAKE。 我尝试过使用php 5.4和5.3 这是我使用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

我也试过VS2005和VS2008。 如果有任何关于如何使用Visual Studio的php源的教程也会非常有帮助。 非常感谢任何帮助,谢谢。

1 个答案:

答案 0 :(得分:0)

只需将项目运行时库从多线程DLL更改为多线程