| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4660 人关注过本帖
标题:在Visual 2005中链接OpenGL,编译错误
只看楼主 加入收藏
hanptmickey9015
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-7-14
收藏
 问题点数:0 回复次数:5 
在Visual 2005中链接OpenGL,编译错误
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C2146: syntax error : missing ',' before identifier 'glAccum'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1152) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1153) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1153) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1153) : error C2146: syntax error : missing ',' before identifier 'glAlphaFunc'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1153) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1153) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1154) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1154) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1154) : error C2146: syntax error : missing ',' before identifier 'glAreTexturesResident'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1154) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1154) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1155) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1155) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1155) : error C2146: syntax error : missing ',' before identifier 'glArrayElement'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1155) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1155) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1156) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1156) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1156) : error C2146: syntax error : missing ',' before identifier 'glBegin'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1156) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1156) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1157) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1157) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1157) : error C2146: syntax error : missing ',' before identifier 'glBindTexture'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1157) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1157) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1158) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1158) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1158) : error C2146: syntax error : missing ',' before identifier 'glBitmap'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1158) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1158) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1159) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1159) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1159) : error C2146: syntax error : missing ',' before identifier 'glBlendFunc'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1159) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1159) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1160) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1160) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1160) : error C2146: syntax error : missing ',' before identifier 'glCallList'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1160) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1160) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1161) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1161) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1161) : error C2146: syntax error : missing ',' before identifier 'glCallLists'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1161) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1161) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1162) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1162) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1162) : error C2146: syntax error : missing ',' before identifier 'glClear'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1162) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1162) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1163) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1163) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1163) : error C2146: syntax error : missing ',' before identifier 'glClearAccum'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1163) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1163) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1164) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1164) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1164) : error C2146: syntax error : missing ',' before identifier 'glClearColor'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1164) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1164) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1165) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1165) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1165) : error C2146: syntax error : missing ',' before identifier 'glClearDepth'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1165) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1165) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1166) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1166) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1166) : error C2146: syntax error : missing ',' before identifier 'glClearIndex'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1166) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1166) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1167) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1167) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1167) : error C2146: syntax error : missing ',' before identifier 'glClearStencil'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1167) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1167) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1168) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1168) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1168) : error C2146: syntax error : missing ',' before identifier 'glClipPlane'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1168) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1168) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1169) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1169) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1169) : error C2146: syntax error : missing ',' before identifier 'glColor3b'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1169) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1169) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1170) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1170) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1170) : error C2146: syntax error : missing ',' before identifier 'glColor3bv'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1170) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1170) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1171) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1171) : error C2085: 'APIENTRY' : not in formal parameter list
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1171) : error C2146: syntax error : missing ',' before identifier 'glColor3d'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1171) : error C2143: syntax error : missing ';' before '('
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1171) : error C2059: syntax error : ')'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1172) : error C2054: expected '(' to follow 'WINGDIAPI'
1>d:\program files\microsoft visual studio 8\vc\platformsdk\include\gl\gl.h(1172) : fatal error C1003: error count exceeds 100; stopping compilation
1>生成日志保存在“file://d:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\xie\xie\Debug\BuildLog.htm”
1>xie - 102 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========
搜索更多相关主题的帖子: OpenGL Visual program visual 
2008-07-14 11:32
hanptmickey9015
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-7-14
收藏
得分:0 
源码很简单:
PIXELFORMATDESCRIPTOR pixelDesc;

  pixelDesc.nSize = sizeof(PIXELFORMATDESCRIPTOR);

   pixelDesc.nVersion = 1;

   pixelDesc.dwFlags = PFD_DRAW_TO_WINDOW;  
   PFD_STEREO_DONTCARE;

   pixelDesc.iPixelType = PFD_TYPE_RGBA;

   pixelDesc.cColorBits = 24;

   pixelDesc.cRedBits = 0;

   pixelDesc.cRedShift = 0;

   pixelDesc.cGreenBits = 0;

   pixelDesc.cGreenShift = 0;

   pixelDesc.cBlueBits =0;

   pixelDesc.cBlueShift = 0;

   pixelDesc.cAlphaBits = 0;

   pixelDesc.cAlphaShift = 0;

   pixelDesc.cAccumBits = 0;

   pixelDesc.cAccumRedBits = 0;

   pixelDesc.cAccumGreenBits = 0;

   pixelDesc.cAccumBlueBits = 0;

   pixelDesc.cAccumAlphaBits = 0;

   pixelDesc.cDepthBits = 32;

   pixelDesc.cStencilBits = 0;

   pixelDesc.cAuxBuffers = 0;

   pixelDesc.iLayerType = PFD_MAIN_PLANE;

   pixelDesc.bReserved = 0;

   pixelDesc.dwLayerMask = 0;

   pixelDesc.dwVisibleMask = 0;

   pixelDesc.dwDamageMask = 0;

  int m_GLPixelIndex;

     m_GLPixelIndex = ChoosePixelFormat(my_pDC->GetSafeHdc(), &pixelDesc);

   if (m_GLPixelIndex==0)  
   {
      MessageBox("chooseformat failed");
     return false;
     }

   if (DescribePixelFormat(my_pDC->GetSafeHdc(), m_GLPixelIndex,sizeof(PIXELFORMATDESCRIPTOR), &pixelDesc)==0)

   {
        MessageBox("describe format failed");
       return false;

   }

    

   if (SetPixelFormat( hDC, m_GLPixelIndex, &pixelDesc)==FALSE)

   {
       
       return false;

   }

   return true;
2008-07-14 11:33
hanptmickey9015
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-7-14
收藏
得分:0 
感觉就是个简单的错误,但我是新手,快晕死了。
2008-07-14 11:35
hanptmickey9015
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-7-14
收藏
得分:0 
为什么OpenGL头文件gl.h会出错?
2008-07-14 11:43
hnczljt
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-6-27
收藏
得分:0 
报这么多错 ,一般是你写错了什么字段,或是标点打错了,你好好看看你的代码,仔细点
2008-07-18 22:40
快速回复:在Visual 2005中链接OpenGL,编译错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018916 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved