Не удается открыть источник файл gl glut h
Репутация: 1
Всего: 3
Прилинковал opengl32.lib glu32.lib glaux.lib glut32.lib.
Код |
GLMmodel* pmodel=NULL; pmodel = glmReadOBJ("f-16.obj"); glmUnitize(pmodel); glmFacetNormals(pmodel); glmVertexNormals(pmodel, 90.0); glmDraw(pmodel, GLM_SMOOTH | GLM_MATERIAL); |
BitScrollDlg.cpp
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(278) : error C2065: 'GLMmodel' : undeclared identifier
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(278) : error C2065: 'pmodel' : undeclared identifier
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(279) : error C3861: 'glmReadOBJ': identifier not found
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(280) : error C3861: 'glmUnitize': identifier not found
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(281) : error C3861: 'glmFacetNormals': identifier not found
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(282) : error C3861: 'glmVertexNormals': identifier not found
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(283) : error C2065: 'GLM_SMOOTH' : undeclared identifier
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(283) : error C2065: 'GLM_MATERIAL' : undeclared identifier
f:\mymfc\2005 myopengl mfc proj\bitscroll\bitscrolldlg.cpp(283) : error C3861: 'glmDraw': identifier not found
Репутация: нет
Всего: 2
glm. что то сомневаюсь что это функции беблиотеки glut. я вообще с расширениями Опена не работал,но что бы функции Glut имели префикс gml это маловероятно.
Если не идти до конца к поставленным целям и не пытатся их достигнуть, каким бы тяжелым не казался путь, то лучше и не ставь их перед собой, но тот кто не ставит перед собой труднодоступные цели, никогда не ощутит эйфорию настоящей победы. победы над миром.
Репутация: нет
Всего: 95
Цитата |
GLM library. Wavefront .obj file format reader/writer/manipulator |
попробуй прикрепи к своему проекту еще файл из аттача.
Присоединённый файл ( Кол-во скачиваний: 20 )
glm.rar 14,63 Kb
Репутация: 1
Всего: 3
Прикрепил glm.h теперь линкер выдает ошибки:
Linking.
LINK : warning LNK4076: invalid incremental status file '.\Debug/BitScroll.ilk'; linking nonincrementally
BitScrollDlg.obj : error LNK2019: unresolved external symbol "void __cdecl glmDraw(struct _GLMmodel *,unsigned int)" ([email protected]@[email protected]@[email protected]) referenced in function "public: void __thiscall CBitScrollDlg::DrawScene(void)" ([email protected]@@QAEXXZ)
BitScrollDlg.obj : error LNK2019: unresolved external symbol "void __cdecl glmVertexNormals(struct _GLMmodel *,float)" ([email protected]@[email protected]@[email protected]) referenced in function "public: void __thiscall CBitScrollDlg::DrawScene(void)" ([email protected]@@QAEXXZ)
BitScrollDlg.obj : error LNK2019: unresolved external symbol "void __cdecl glmFacetNormals(struct _GLMmodel *)" ([email protected]@[email protected]@@Z) referenced in function "public: void __thiscall CBitScrollDlg::DrawScene(void)" ([email protected]@@QAEXXZ)
BitScrollDlg.obj : error LNK2019: unresolved external symbol "float __cdecl glmUnitize(struct _GLMmodel *)" ([email protected]@[email protected]@@Z) referenced in function "public: void __thiscall CBitScrollDlg::DrawScene(void)" ([email protected]@@QAEXXZ)
BitScrollDlg.obj : error LNK2019: unresolved external symbol "struct _GLMmodel * __cdecl glmReadOBJ(char *)" ([email protected]@[email protected]@[email protected]) referenced in function "public: void __thiscall CBitScrollDlg::DrawScene(void)" ([email protected]@@QAEXXZ)
.\Debug/BitScroll.exe : fatal error LNK1120: 5 unresolved externals
Репутация: 1
Всего: 3
В принципе уже сдела- линкер ничего не говорит, ошибок нет, но когда я запускаю программу, окно серенькое блымнет, и все, а дальше идет дамп моего объектного файла с рисунком. что делать?
Репутация: 1
Всего: 3
Вроде исправил все ошибки- изображение самолета есть, но оно белое, бесцветное. То есть фон у меня черный, а самолет весь белый, только очертания его обрисованы и внутри тоже белый. Что делать? Где цвет?
Ситхи не пройдут!
Репутация: 2
Всего: 52
Репутация: 1
Всего: 3
Нет, текстуры я не накладываю. У меня есть два файла с рисунком, созданные в 3D StudioMax.
Эти файлы f-16.obj и f-16.mtl. Причем пишу я программу в MFC. Самолет в окне отображаеться
исключительно белым цветом, одни его очертания, контуры, и залита фигура самолета - тоже белым. весь он короче белый, без раскраски.
Код |
void CBitScrollDlg::OnPaint() |
glTranslatef(0.0f, 0.0f, -7.0f);
GLMmodel* pmodel = NULL;
pmodel = glmReadOBJ("f-16.obj");
glmUnitize(pmodel);
glmFacetNormals(pmodel);
glmVertexNormals(pmodel, 90.0);
glmDraw(pmodel, GLM_SMOOTH | GLM_MATERIAL);
Добавлено через 2 минуты и 59 секунд
причем я видел как эти файлы рисунка самолета используються в одном примере программы (но не MFC)- все нормально, самолет цветной. но мне нужно под MFC, а там в чистом виде все с нуля написано в примере. кстати там как то glut инициализируеться, окно его создаеться. у меня в MFC уже создано окно OpenGL, разве я не могу вывести в него из файла рисунок как мне нужно?
Репутация: нет
Всего: 37
Укажи векторы нормали, а то так и будет просто пятно. + указывай диффузию и материю.
Я знаю, что ничего не знаю© Сократ
Репутация: нет
Всего: 0
Я долго думал и наконецто нашел ответ . :
Репутация: 1
Всего: 3
t_gran - если бы я еще знал что такое векторы нормали. но я только по примерам пытаюсь понять как работает OpenGL и еще не все знаю. если можешь объясни. И еще объясни как указать диффузию и материю? я просто не знаю как это выразить в коде.
GLeBaTi - я работаю в Visual Studio 6.0, glut уже скачал и установил по папочкам. к тому же по твоей ссылке пишеться, что файл отсутствует. мне нужно под MFC писать прогу а не под Builder. а вобще конечно спасибо за помощь!
Репутация: 1
Всего: 3
о! добавил свет и все получилось!
Код |
void CBitScrollDlg::OnPaint() |
glTranslatef(0.0f, 0.0f, -7.0f);
GLfloat light_position[] = < 1.0, 1.0, 1.0, 0.0 >;
GLfloat light_diffuse[] = ;
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
//glEnable(GL_COLOR_MATERIAL);
//GLfloat m_matDiffuse[] = ;
//glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, m_matDiffuse);
GLMmodel* pmodel = NULL;
pmodel = glmReadOBJ("f-16.obj");
glmUnitize(pmodel);
glmFacetNormals(pmodel);
glmVertexNormals(pmodel, 90.0);
glmDraw(pmodel, GLM_SMOOTH | GLM_MATERIAL);
не могу подключить glut в eclipse
Друзья, помогите пожалуйста подключить библиотеку glut к eclipse. Перешел с Microsoft Visual.
Работа с трехмерными примитивами. Вокруг конуса GLU вращаются сфера GLUT и конус GLUT
создание виртуальной камеры gluLookAt и добавление эффектов анимации. вот само задание Вокруг.
OpenGL недостатки по библиотекам (GLUT, GLAUX) Где скачать, как подключить, как работать в среде Visual Studio
Решил проверить как работают эти библиотеки дабы понять разницу работы без них. Также обнаружил.
С++ и glut
Недавно начала работать с С++ и с glut. Ответе на пару вопросов плиз. 1)Обязательно ли в.
В свойствах проекта, С/С++, общие, Дополнительные каталоги включаемых файлов, прописать путь к папке с этим файлом.
Хедеры скопируйте например как у меня в C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\GL
статические библиотеки (lib) в C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib
динамические (dll) в C:\Windows\System
Добавлено через 42 секунды
После этого среда сама все найдет
Хедеры скопируйте например как у меня в C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\GL
статические библиотеки (lib) в C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib
Если так все библиотеки подключать, то представь, что, со временем, у тебя будет твориться в папках студии? Если другую версию библиотеки подключить? Разбирайся потом, что там от чего. По-моему, плохой способ (хотя и самый простой).
Если не хочешь разбираться что к чему, то можно создавать папки GL, GTK, DirectX и т.д. Я пока что не увидел в этом проблем. Но еще раз замечу - это справедливое замечание.
Сделал все, как ты написал .
два файла (glut32.dll и glut.dll) качнул и закинул в папки C:\Windows\System32 и C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Библиотеки
Путь прописал (побывал по обоим адресам)
>------ Построение начато: проект: рисуем, Конфигурация: Debug Win32 ------
1> рисунок.cpp
1>c:\users\user\desktop\рамис\с++\рисуем\рисуем\рисунок.cpp( 1): fatal error C1083: Не удается открыть файл включение: GL/glut.h: No such file or directory
========== Построение: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
Добавлено через 7 минут
Хедеры скопируйте например как у меня в C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\GL
статические библиотеки (lib) в C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib
динамические (dll) в C:\Windows\System
Добавлено через 42 секунды
После этого среда сама все найдет
Короче выдает мне Студия 2010 Вот такую ошибку - Не удается открыть файл glut32.lib
файлы кидал по этим папкам :
dll - C:\Windows\System32
.lib - C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\IA64
.h - C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\gl
Помогите а то я уже голову сломал
Вот исходник :
Ошибка с подключением вложенных библиотек
Создаю в Qt Creator, но думаю, что проблема не в нём. Создаю статическую библиотеку lib1 в Qt.
-.lib нужно кидать в папку:
. /*Здесь папка, где установлена VS10*/VC/lib/
p.s. лично я .lib вообще не включаю, их glut.h включает автоматом (это я о коде программы)
-.lib нужно кидать в папку:
. /*Здесь папка, где установлена VS10*/VC/lib/
p.s. лично я .lib вообще не включаю, их glut.h включает автоматом (это я о коде программы)
.
Да что ж тут думать-то, если вам все равно что это за файл, и где он находится!
Сделайте как я - киньте .dll файл в папку VC, include и lib
Ну и в системную папку, конечно
.
Да что ж тут думать-то, если вам все равно что это за файл, и где он находится!
Сделайте как я - киньте .dll файл в папку VC, include и lib
Ну и в системную папку, конечно
Кинул во все эти папки и все равно тоже самое. может проект не такой создаю Консольное приложение win32 .
Подключи либы:
winmm.lib
gdi32.lib
Добавлено через 3 минуты
.
Сделайте как я - киньте .dll файл в папку VC, include и lib
Ну и в системную папку, конечно
Должно работать :)
Ахах, рабочий вариант. jokingly: Да еще разложи glut32.dll вокруг exeшника и постучи в барабан:D
Добавлено через 8 минут
У меня кстати твоя программа сразу заработала в devC++
Подключи либы:
winmm.lib
gdi32.lib
Добавлено через 3 минуты
Ахах, рабочий вариант. jokingly: Да еще разложи glut32.dll вокруг exeшника и постучи в барабан:D
в проге подключил , но все равно тоже самое, может dll кривое .
devC++ извини туплю наверное но что это?))))
в проге подключил , но все равно тоже самое, может dll кривое .
devC++ извини туплю наверное но что это?))))
Решение
а у тебя glut32 есть? или glu32 одно и тоже?))
скачал новый dll все равно (((((
Все заработало))) Оказывается надо glut32dll кидать не в system32 а в system )) в system32 она до этого была) а я уже glut32dll накидал куда можно)) Всем спасибо за помощь.
Возьми сотри у себя все include и pragma и напиши
Разве не работает.
Ой не тот файл.
Сейчас посмотрела в системной папке там вообще нету глут32.длл, но у меня работат программа получается без него. О_о
Ой не тот файл.
Сейчас посмотрела в системной папке там вообще нету глут32.длл, но у меня работат программа получается без него. О_о
Наверное тоже колдовали :D
Возьми сотри у себя все include и pragma и напиши
Разве не работает.
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__gluNewQuadric@0 в функции "void __cdecl Init(void)" (?Init@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glEnable@4 в функции "void __cdecl Init(void)" (?Init@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glLightfv@12 в функции "void __cdecl Init(void)" (?Init@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glMaterialfv@12 в функции "void __cdecl Init(void)" (?Init@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glShadeModel@4 в функции "void __cdecl Init(void)" (?Init@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glClearColor@16 в функции "void __cdecl Init(void)" (?Init@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glEnd@0 в функции "void __cdecl DrawGraphic(void)" (?DrawGraphic@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glVertex3d@24 в функции "void __cdecl DrawGraphic(void)" (?DrawGraphic@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glColor3d@24 в функции "void __cdecl DrawGraphic(void)" (?DrawGraphic@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glBegin@4 в функции "void __cdecl DrawGraphic(void)" (?DrawGraphic@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glPopMatrix@0 в функции "void __cdecl DrawFigure(void)" (?DrawFigure@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutSolidOctahedron@0 в функции "void __cdecl DrawFigure(void)" (?DrawFigure@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutWireOctahedron@0 в функции "void __cdecl DrawFigure(void)" (?DrawFigure@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glScalef@12 в функции "void __cdecl DrawFigure(void)" (?DrawFigure@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__gluCylinder@36 в функции "void __cdecl DrawFigure(void)" (?DrawFigure@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glTranslatef@12 в функции "void __cdecl DrawFigure(void)" (?DrawFigure@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glRotatef@16 в функции "void __cdecl DrawFigure(void)" (?DrawFigure@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glPushMatrix@0 в функции "void __cdecl DrawFigure(void)" (?DrawFigure@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutPostRedisplay@0 в функции "void __cdecl KeyboardFunc(unsigned char,int,int)" (?KeyboardFunc@@YAXEHH@Z)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutSwapBuffers@0 в функции "void __cdecl DrawFunc(void)" (?DrawFunc@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__gluLookAt@72 в функции "void __cdecl DrawFunc(void)" (?DrawFunc@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glLoadIdentity@0 в функции "void __cdecl DrawFunc(void)" (?DrawFunc@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__gluQuadricDrawStyle@8 в функции "void __cdecl DrawFunc(void)" (?DrawFunc@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glDisable@4 в функции "void __cdecl DrawFunc(void)" (?DrawFunc@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glClear@4 в функции "void __cdecl DrawFunc(void)" (?DrawFunc@@YAXXZ)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glOrtho@48 в функции "void __cdecl ReshapeFunc(int,int)" (?ReshapeFunc@@YAXHH@Z)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glMatrixMode@4 в функции "void __cdecl ReshapeFunc(int,int)" (?ReshapeFunc@@YAXHH@Z)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ __imp__glViewport@16 в функции "void __cdecl ReshapeFunc(int,int)" (?ReshapeFunc@@YAXHH@Z)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutTimerFunc@12 в функции "void __cdecl TimerFunc(int)" (?TimerFunc@@YAXH@Z)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutSetWindowTitle@4 в функции "void __cdecl TimerFunc(int)" (?TimerFunc@@YAXH@Z)
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutMainLoop@0 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutIdleFunc@4 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutMotionFunc@4 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutMouseFunc@4 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutKeyboardFunc@4 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutReshapeFunc@4 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutDisplayFunc@4 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutCreateWindow@4 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutInitDisplayMode@4 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutInitWindowPosition@8 в функции _main
1>олег 2.obj : error LNK2019: ссылка на неразрешенный внешний символ _glutInitWindowSize@8 в функции _main
All replies
Specially, i have my include path set to: $(FrameworkSDKDir)\include\gl in my VC++ directories
With all that said and done..when i compile i get the following error:
fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory
1. Try using without the "gl/".
See if that gets you past the error message. If not, make the following change also.
2. In addition, try adding the following to your VC++ Include Path:
$(Program Files)\ actual-name-of-platformSDK-directory \include\gl
or if you didn't install the PSDK in its default location, use the full path name that you did use (no $ variables). I don't believe $(FrameworkSDKDir) is intended to apply to the Platform SDK.
3. I am concerned that your configuration may have been destabilized by the mingling of other material in the PSDK directories (VC++ can find it anywhere you tell it), and that you will also have problems finding the libraries after you get past the problem with the headers. (You'll also have to eventually deal with the fact that each PSDK update installs in a different location.) Let's get past the current problem. Once you are satisfied that you've got everything working, you can consider whether it is worthwhile to do a clean re-install and organize the files differently.
Thanks for taking the time to help me out.
!. I've tried it just now, same error.
2. You mean something like this: " $(Program Files)\Microsoft Platform SDK\include\gl "? tried it also, doesnt work. I even just use a full path name without any variable like this: D:\Program Files\Microsoft Platform SDK\include\gl (normally this should work, but its not working anymore. argh).
and it still doesnt see my glut.h header file. I was using CodeBlock IDE for awhile but following a MS Visual C++ 2003 tutorial with it would be painful, since i'm new to C++ programming, Never had this problem before until recently. It bad to the point that i cant do a simple program like this:
using namespace std;
fatal error LNK1104: cannot open file 'kernel32.lib'
3. At this point a clean re-install would be welcome, but how does one do a "clean-reinstall" i was reinstalling VC++ Express 3 times yesterday, it still had all my default paths in the "C++ directories" so maybe that info is stored somewhere else on computer and the during uninstall it doesnt delete it? Anyway, can you walk me thru a "clean re-install"?
The first step of a clean re-install is to uninstall everything so there is no remnant of the older materials on your system.
1. Uninstall Visual C++ 2005 Express Edition using Add / Remove Programs.
2. Uninstall the Windows Platform SDK.
3. If you have set any default environment variables in your configuration that apply specifically to VC++ and the PSDK, delete those too.
4. Make sure you have the gl files someplace where you can re-install them.
5. In the $(Program Files) location on your machine, delete any of the folders that remain: Mcrosoft Visual Studio 8 and Microsoft Platform SDK . .
6. Save any code that you want to preserve from existing VC++ Express Edition projects. Then delete your My Documents\Visual Studio 2005 directory.
That should get you a clean system.
7. First, reinstall Visual C++ 2005 Express Edition without attempting to add the PSDK or anything else (SQL Server Express Edition and the MSDN libraries are fine. The MSDN libraries are indispensible.) Allow default directory choices if you can.
8. Confirm that you can create simple projects using VC++ File | New | Project . with the Visual C++ | General project type and Empty Project template. (I usually don't check "Create directory for solution.") You can do all of the ANSI/ISO C/C++ simple applications that you want to make sure that the compiler and IDE are working properly.
When you get to this point, and you are satisfied that you can build non-Windows native applications, let's talk about the Platform SDK. I'd like to know which one you are using. The latest one is the one that installs to "$(Program Files)\Microsoft Platform SDK for Windows Server 2003 R2" and the latest instructions apply to that. Make sure you have that one.
When you are ready to install and integrate the PSDK with Visual C++ Express Edition, say so. I want to be sure that you are using the proper integration instructions.
After that, we can look at adding the gl libraries in a way that keeps it as simple as possible.
step 1 to 6 done. It should give me a clean system, but to my suprised i saw the same path setup in the VC++ directories(scary. ). This time i just use the default C drive for the install.
And of course, with my luck it doesnt work. I compile a simple win32 console app, couting some basic messege.Im getting this error messege now:
fatal error LNK1181: cannot open input file 'kernel32.lib'
IMO my variable path in the VC++ directories are screw up, plus maybe the fact that my Environment Variables arent setup properly(or missing). After the install i check, and VC++ setup one environment variable only:
variable name: VS80COMNTOOLS
variable value: C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
Theres no other variable that remotely looks like VC++ related, not even a PATH variable.
So i guess what i need help on is, what variables to use in VC++ directories and also the environment variable(i assume im missing some).
VS80COMNTOOLS is set up as part of the install. Other environment variables are setup and removed on an as-needed basis. Don't worry about that just now. You do not need to intervene on what VC++ does in this regard.
You're doing fine.
I don't understand how you saw VC++ directories in step 6. VC++ should not have been installed until step 7. Did you uninstall it using Windows Add/Remove Programs in step 1?
Here's what you should see in your VC++ Directories panes:
Under Executable Files:
$(VCInstallDir)bin
$(VCInstallDir)PlatformSDK\bin
. [bunch more] .
$(Path)
Under Include Files:
$(VCInstallDir)include
$(VCInstallDir)PlatformSDK\include
$(FrameWorkSDKDir)include
Under Library Files:
$(VCInstallDir)lib
$(VCInstallDir)PlatformSDK\lib
. [3 others] .
$(VSInstallDir)lib
This is a generic setup and not all of the directories actually exist. Don't worry about that. Just leave this setup alone.
Please confirm that this is what you have (with none of the PSDK installation instructions carried out yet).
yes, i have done step 1 to 7, on 7 step i reinstalled VS C++ Express(the IDE) and i didnt the PSDK yet.
and yes i did remove the both the PSDK and VS C++ Express with Widnows Add/Remove program.
seem i have most of those VC++ directories for the include/Exe/Lib. what i dont have is any variable related to Express in the Environment Variables for my system. (expect for the one i already mention).
You are looking for variables that do not exist. The installation of VC++ 2005 Express Edition defines only the one environment variable that you have alread noticed. There are none missing.
Let's divide the problem here. I'll show you how and when environment variables are defined.
1. VC++ Directories. First, confirm that the lists of directories that I showed you are the lists that you have (with some from the middle of longer lists not shown). We need to be sure of that so that we can determine why your VC++ Project does not compile.
2. Command-Line Environment Setup. Now, for using the VC++ command-line compiler and other tools from a console session, you will need more environment variables. But only if you are doing it that way. Here is a way to have the variables all defined and ready to go.
2.1 In Visual C++ 2005 Express Edition, select Tools | Visual Studio 2005 Command Prompt
2.2 Notice that the first command executed in the console session that opens up is a .bat file at a particular location. Hold that thought.
2.3 Perform the console command
2.4 You should see a bunch of definitions that are not present when you simply open the Command Prompt in Windows. On my configuration, there are
2.5 Those definitions are all you need to build standard C/C++ console (non-Windows) applications using the command-line compiler. Because the VC++ Tools | Visual Studio 2005 Command Prompt puts you in an awkward place, I find it valuable to create my own "command-prompt" shortcuts that put me in the Projects directory but run the environment definition batch file vcvars.bat as part of their startup.
2.6 When you install the Platform SDK, there are additional batch files that are installed that you can use for command-line operation. The general approach is to run the VC++ one, followed by the appropriate PSDK one.
2.7 You will also need to set compiler options yourself. For a simple C++ compilation, you will simply need a command line like this:
C:\MyProjects\Hello> cl /EHsc hello.cpp
3. So were your errors as part of command-line compiles, or do we need to continue to find out why your simple C++ program couldn't compile for lack of kernel32.lib ?
В этой статье я расскажу как установить графическую библиотеку glut, и покажу вам самый элементарный пример программы с его использование, пользуясь средой разработки "Microsoft Visual C++ Express 2010"
Glut предназначен для создания/манипуляции окон, вывода графики.Так же glut прекрасно подходит для освоения OpenGL.
1)Начнём с glut32.dll.Его мы должны перекинуть по этому адресу:
C://Windows/System32
2)glut32.lib надо перекинуть по этому адресу:
C://Program files/Microsoft Visual Studio/VC/lib
3)Для glut.h Мы создадим папку по адресу . /VC/include , назовём её GL.И в эту папку перекинем glut.h.
(Таким же образом можно установить библиотеки gl.h и glu.h все файлы можно скачать по отдельности здесь)
4)Открываем Microsoft Visual C++.Создаём проект.(Win32->Консольное приложение(пустой проект))
5)Правой кнопкой жмём на проект ->Cвойства->Открываем вкладку "Компоновщики".В "Дополнительных зависимостях"пишем:
opengl32.lib glut32.lib glu32.lib
Установка завершена!
Перейдём к программе написанной с помощью glut.
Для подключения заголовочного файла нам нужно написать:
void display()
<
glClear(GL_COLOR_BUFFER_BIT); /*Функция очищения экрана*/
glBegin(GL_LINES);//начало рисования линий
glColor3f(1.0, 0.0, 0.0); //цвет красный
//Нарисуем квадрат
glVertex2f(0.4, 0.4);//координаты начальной точки лини
glVertex2f(0.4, 0.8);//координаты конечной точки линии
//
glVertex2f(0.4, 0.8);/*2f - означает что рисуем мы в 2-х мерном пространстве*/
glVertex2f(0.8, 0.8);
//
glVertex2f(0.8, 0.8);
glVertex2f(0.8, 0.4);
//
glVertex2f(0.4, 0.4);
glVertex2f(0.8, 0.4);
glEnd();
glFlush(); /*Отрисовывает всё, что мы описали*/
>
void display()
<
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_LINES);
glColor3f(1.0, 0.0, 0.0);
glVertex2f(0.4, 0.4);
glVertex2f(0.4, 0.8);
//
glVertex2f(0.4, 0.8);
glVertex2f(0.8, 0.8);
//
glVertex2f(0.8, 0.8);
glVertex2f(0.8, 0.4);
//
glVertex2f(0.4, 0.4);
glVertex2f(0.8, 0.4);
glEnd();
glFlush();
int main(int argc, char **argv)
<
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(240, 240);
glutInitWindowPosition(100, 740);
glutCreateWindow("First window!");
glClearColor(1.0, 1.0, 1.0, 1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glutDisplayFunc(display);
glutMainLoop();
>
Answers
Specially, i have my include path set to: $(FrameworkSDKDir)\include\gl in my VC++ directories
With all that said and done..when i compile i get the following error:
fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory
1. Try using without the "gl/".
See if that gets you past the error message. If not, make the following change also.
2. In addition, try adding the following to your VC++ Include Path:
$(Program Files)\ actual-name-of-platformSDK-directory \include\gl
or if you didn't install the PSDK in its default location, use the full path name that you did use (no $ variables). I don't believe $(FrameworkSDKDir) is intended to apply to the Platform SDK.
3. I am concerned that your configuration may have been destabilized by the mingling of other material in the PSDK directories (VC++ can find it anywhere you tell it), and that you will also have problems finding the libraries after you get past the problem with the headers. (You'll also have to eventually deal with the fact that each PSDK update installs in a different location.) Let's get past the current problem. Once you are satisfied that you've got everything working, you can consider whether it is worthwhile to do a clean re-install and organize the files differently.
VS80COMNTOOLS is set up as part of the install. Other environment variables are setup and removed on an as-needed basis. Don't worry about that just now. You do not need to intervene on what VC++ does in this regard.
You're doing fine.
I don't understand how you saw VC++ directories in step 6. VC++ should not have been installed until step 7. Did you uninstall it using Windows Add/Remove Programs in step 1?
Here's what you should see in your VC++ Directories panes:
Under Executable Files:
$(VCInstallDir)bin
$(VCInstallDir)PlatformSDK\bin
. [bunch more] .
$(Path)
Under Include Files:
$(VCInstallDir)include
$(VCInstallDir)PlatformSDK\include
$(FrameWorkSDKDir)include
Under Library Files:
$(VCInstallDir)lib
$(VCInstallDir)PlatformSDK\lib
. [3 others] .
$(VSInstallDir)lib
This is a generic setup and not all of the directories actually exist. Don't worry about that. Just leave this setup alone.
Please confirm that this is what you have (with none of the PSDK installation instructions carried out yet).
Question
Before you ask , yes i already have search the forum, heck i even search yahoo for an asnwer. Very new to V C++ Express still, and i have the Platform SDK installed. I've seen the video, modified the proper files for VC++ Express.
Im currently writing a small/simple win 32 console app, using the glut library. I download GLUT, put it into the proper location:
glut into D:\Program Files\Microsoft Platform SDK\include\gl
glut32.lib into D:\Program Files\Microsoft Platform SDK\Lib
glut32.dll into C:\WINDOWS\system32
const GLsizei windowWidth = 500;
const GLsizei windowHeight = 500; */
I have $FrameworkSDKDir( without the $ sign of course) variable set to D:\Program Files\Microsoft Platform SDK in my System variables.
I also have $VSInstallDir variable set to D:\Program Files\Microsoft Visual Studio 8 again in my System variable.
Specially, i have my include path set to: $(FrameworkSDKDir)\include\gl in my VC++ directories
With all that said and done..when i compile i get the following error:
fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory
PS i even added glut32.lib to my linker input option.
So whats going on?
Answered by:
Читайте также: