From: Brian P. <bri...@tu...> - 2005-08-11 14:24:51
|
=CD=A2=BF=A1 =D1=EE wrote: > I write a SPU called warpvertexspu to warp the image by a Cg program.= =20 > In the warpvertexspu.h, > I include the cg.h and cgGL.h and in warpvertexspu_init.c and=20 > warpvertexspu.c I call cg and cgGL functions. But after I compile the=20 > source by adding -lCgGL and -lCg to the LDFLAGS variable in the=20 > makefile, when I use the warpvertexspu.so , It says "DLL could find/ope= n=20 > the warpvertexspu.so". But if I comment the cg and cgGL functions in th= e=20 > warpvertexspu.c and keep the cg functions in the warpvertexspu_init.c,=20 > after compile the SPU can work well. > the warpvertexspu.c: >=20 > #include <stdio.h> > #include "cr_spu.h" > #include "warpvertexspu.h" >=20 >=20 > static void WARPVERTEXSPU_APIENTRY warpvertexBegin(GLenum mode) > { > if(WarpParam!=3DNULL) > cgGLSetMatrixParameterfc(WarpParam,WarpM); > if(ModelViewProjParam!=3DNULL) > cgGLSetStateMatrixParameter(ModelViewProjParam, > CG_GL_MODELVIEW_PROJECTION_MATRIX, > CG_GL_MATRIX_IDENTITY); > cgGLEnableProfile(profile); > warpvertex_spu.super.Begin(mode); > } >=20 > static void WARPVERTEXSPU_APIENTRY warpvertexEnd(void) > { > warpvertex_spu.super.End(); > cgGLDisableProfile(profile); > } > SPUNamedFunctionTable _cr_warpvertex_table[] =3D { > { "Begin", (SPUGenericFunction)warpvertexBegin }, > { "End", (SPUGenericFunction)warpvertexEnd }, > { NULL, NULL } > }; >=20 > I don't know why calling cg functions in the warpvertexspu_int.c can=20 > work well but calling in the warpvertexspu.c cannot work. Maybe there i= s=20 > something wrong with the makefile.could you give me some help? > Thanks very much! Try running 'ldd libwarpvertex.so'. There may be some unresolved=20 dependencies. -Brian |