I’ve tested linking and it works just fine using VC++ 6.0. Are you sure you are using the right gl.h header file?
Your error messages show that the linker is trying to link _gl<…> functions, though it should link __imp__gl<…> instead. This indicates that the functions are not declared as __declspec(dllimport). Usually that should be the case as GL_API should be #define’d as __declspec(dllimport) at the top of GLES/gl.h.
glClearColor is not part of the OpenGL ES Common Lite profile (libgles_cl.lib). Use glClearColorx if you require Common Lite.
Yes, that should be the correct header file. Please make sure this is the only (or at least the first) gl.h on your include path. You can easily check by adding a syntax error to it and see whether it still compiles.
Which version of the PowerVR SDK are you using? Is there a line with #define GL_API __declspec(dllimport)
at the top of gl.h? Does that line get used?
1)i don’t know the version of the PVR SDK. but i just download it recently.
2)there are no "#define GL_API __declspec(dllimport) " in gl.h
3)even i add "#define GL_API __declspec(dllimport) " manually, there are still linking error msg.
It seems like your gl.h header file is either leftover from a very old PowerVR SDK install or from a different source altogether. HelloTriangle is a recent addition, but the #define GL_API line has been there for ages. Could you please check the date on that file?
Ok, so this seems to be the OpenGL ES 1.0 PC Emulation SDK
Please try these steps (assuming you unzipped the SDK package to C:\PowerVR, replace as required):
[ul][li]Create a new empty Win32 project in VC++ 6.0[/3me0sm35][/li][li]Add OGLESHelloTriangle_Windows.cpp to the Source Files[/3me0sm35][/li][li]Open the project settings (Alt+F7) and set the following for All configurations:[/li][list:3me0sm35][li]In the Debug tab, category General, set the Working directory to C:\PowerVR\SDKPackage\Builds\OGLES\WindowsPC\Lib[/3me0sm35][/li][li]In the C/C++ tab, category Preprocessor,[/li][list:3me0sm35][li]add OGLESLITE to the Preprocessor definitions[/3me0sm35][/li][li]add C:\PowerVR\SDKPackage\Builds\OGLES\Include;C:\PowerVR\SDKPackage\Builds\OGLES\WindowsPC\Include to Additional include directories[/3me0sm35][/ul][/3me0sm35][]In the Link tab, category Input,[/li][ul][li]add libgles_cl.lib to Object/library modules[/3me0sm35][/li][]add C:\PowerVR\SDKPackage\Builds\OGLES\WindowsPC\Lib to Additional library path[/3me0sm35][/ul][/3me0sm35][/list:u:3me0sm35][/3me0sm35][]Build and run the project[/3me0sm35][/list:u:3me0sm35]Following these steps, building and running worked fine for me.