(swig)使用c++;PHP中的共享库(so)

(swig)使用c++;PHP中的共享库(so),php,c++,shared-libraries,swig,Php,C++,Shared Libraries,Swig,我正在Ubuntu 14.04下运行一个应用程序。我想在我的PHP代码中使用C++共享库(.so)。我没有这个库的源代码。我只有libMyLib.so文件和.so的头文件 这是我的libMyLib.h #ifndef MyLib_H #define MyLib_H #include "ITest.h" #include <string> class MyLib { public : virtual int setParam(int ID, int value)

我正在Ubuntu 14.04下运行一个应用程序。我想在我的PHP代码中使用C++共享库(.so)。我没有这个库的源代码。我只有libMyLib.so文件和.so的头文件

这是我的libMyLib.h

#ifndef MyLib_H
#define MyLib_H
#include "ITest.h"
#include <string>

class MyLib {    
public :   
    virtual int setParam(int ID, int value) = 0;
    virtual int getValue(int ID, int *value) = 0;

};
如果没有源代码,我现在如何使用swig?有没有其他方法可以在php中使用这个共享库而不使用swig


谢谢你的回复,我很感激

您所需要的只是头文件,然后将生成的代码链接到。因此,您所需要的只是头文件,然后将生成的代码链接到。因此
#ifndef ITest_H
#define ITest_H
class ITest {
public :

    enum firstEnum {       
        INT = 1,
        STRING = 2

    };

    struct sValue {
        ....
    };
};