我有一個C++項目,在頭文件中定義如下:無法找到名爲*切入點在DLL
typedef enum /* Set operation type */
{
GPC_DIFF, /* Difference */
GPC_INT, /* Intersection */
GPC_XOR, /* Exclusive or */
GPC_UNION /* Union */
} gpc_op;
typedef struct /* Polygon vertex structure */
{
double x; /* Vertex x component */
double y; /* vertex y component */
} gpc_vertex;
typedef struct /* Vertex list structure */
{
int num_vertices; /* Number of vertices in list */
gpc_vertex *vertex; /* Vertex array pointer */
} gpc_vertex_list;
typedef struct /* Polygon set structure */
{
int num_contours; /* Number of contours in polygon */
int *hole; /* Hole/external contour flags */
gpc_vertex_list *contour; /* Contour array pointer */
} gpc_polygon;
void gpc_polygon_clip (gpc_op set_operation,
gpc_polygon *subject_polygon,
gpc_polygon *clip_polygon,
gpc_polygon *result_polygon);
我編譯它在VS 2008它可以編譯!到現在爲止還挺好。
接下來,我想打電話從.NET中的C++的dll,我做一個標準的PInvoke:
[DllImport("gpc.dll")]
private static extern void gpc_polygon_clip([In] GpcOperation set_operation,
[In] ref gpc_polygon subject_polygon,
[In] ref gpc_polygon clip_polygon,
[In, Out] ref gpc_polygon result_polygon);
但是當我運行的代碼,我得到一個「無法找到切入點名*在DLL'gpc.dll'「。
我想我的C++ vcproj設置必須是錯誤的,因爲它似乎沒有導出定義。任何想法如何解決這個問題?
編譯器正在修改名稱,您需要正確導出函數。 – 2010-08-02 08:08:50