On 4/30/07, shenyan <syshieley@hotmail.com> wrote:

Dear all.
when using GLew, there are warnings when i am compiling the program, can anyone give me suggestions?
thanks in advance
d:\arproject\project\winar(0407 single cameras machinist)\src\glew.c(220) : warning C4273: '__glewCopyTexSubImage3D' : inconsistent dll linkage.  dllexport assumed.

Short answer: #define GLEW_STATIC

Long answer:

From glew.h

 * GLEW_STATIC needs to be set when using the static version.
 * GLEW_BUILD is set when building the DLL version.
#  define GLEWAPI extern
#  ifdef GLEW_BUILD
#    define GLEWAPI extern __declspec(dllexport)
#  else
#    define GLEWAPI extern __declspec(dllimport)
#  endif

When you are building the library, you want the __declspec(dllexport), when you're using the library, you want the declspec(dllimport) (this should work automagically). However, when you're just including glew.c in your project, you want neither, and hence #define GLEW_STATIC (e.g. add it to the preprocessor options).

- Andreas