On 4/30/07, shenyan <email@example.com> wrote:
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
* 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)
# define GLEWAPI extern __declspec(dllimport)
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).