11-15-2008, 10:22 AM
I am using visual C++ with open gl for my applications. I am just a bit confused as to the proper way to set up a project.
So i start by creating a new project, console32 application as i was told by tutor. And then i have a project folder created. This is ok and works fine when i do programs with just one class. What i dont understand is the way to add like .h files to my project or other .c classes.
I normally just go to new-file and then choose the file type, but then say if i create a new .h file, and then add #include "new.h" to my main c++ file, i always get returned the error: skipped looking for new.h .......
So my question is, what is the proper way to add .c and .h files to my project. And secondly, can anyone just briefly explain to me what exactly a .h file is?
11-15-2008, 10:48 AM
Look at the video on this web page (http://msdn.microsoft.com/en-us/beginner/bb964629.aspx). The first 10 minutes can be boring but after the introduction, the information you want are there.
11-15-2008, 11:09 AM
I actually figured out a way, but i will watch the video aswell. Can you just quickly help me with somthing.
I am trying to put a texture on a cube. I have a texture c++ file and a texture .h file which works because i have used it in somthing else. And then i created my own class like so
#include <GL\glaux.h> //Used for loading the textures
COGLTexture Tex1, Tex2;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
//Draws a cube with two shaded, two one-colored and two textured faces
void reshape(int x, int y)
if (y == 0 || x == 0) return;
int main(int argc, char **argv)
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glFrontFace(GL_CW); //Clockwise is front in "DrawCube()"
When i compile it, i am being returned the error
1>------ Build started: Project: coursework2, Configuration: Debug Win32 ------
1>textures.obj : error LNK2019: unresolved external symbol _auxDIBImageLoadA@4 referenced in function "public: void __thiscall COGLTexture::LoadFromFile(char *)" (?LoadFromFile@COGLTexture@@QAEXPAD@Z)
1>C:\Users\Nick\Desktop\University\Graphics, C++\coursework2\Debug\coursework2.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Nick\Desktop\University\Graphics, C++\coursework2\coursework2\Debug\BuildLog.htm"
1>coursework2 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
but when i double click on it, it doesnt point me to any line. Do you know why i would be recieving this error?
11-15-2008, 11:37 AM
I think, but I am not sure for this one, that COGLTexture object require a library provided by glaux. Search if you can find a library (not the include file) with the name glaux (glaux.lib maybe) on your system and add it where you have added the glut library.
Edit: after searching, it seem that you forget to add the glaux.lib in your project. Look at this (http://www.experts-exchange.com/Programming/Languages/CPP/Q_20278170.html) at the bottom of the page.
11-15-2008, 12:01 PM
Now i really am confused. Apparantly, the glaux lib has been depreciated. So how would i now put a texture onto my cube?
11-15-2008, 12:15 PM
Read this article (http://www.gamedev.net/reference/articles/article1966.asp).That may help you.
12-17-2010, 01:27 PM
i m using the same texture mapping code and i also receiving the same error:: error LNK2019
plzz. help me........
I have a demo that loads .bmp files and displays them as images with glDrawPixels or as textures. The demo contains the code that loads the images, so glaux is not needed. It's at -
Have fun. Let me know if it was helpful.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.