Hi guys.
I was using this code in VC++ 2005 and I got 3 errors.
Errors:
Error 1 error LNK2019: unresolved external symbol __imp____glutInitWithExit@12 referenced in function _glutInit_ATEXIT_HACK@8 main.obj
Error 2 error LNK2019: unresolved external symbol __imp____glutCreateWindowWithExit@8 referenced in function _glutCreateWindow_ATEXIT_HACK@4 main.obj
Error 3 fatal error LNK1120: 2 unresolved externals D:\C++\OpenGL\My App\Debug\My App.exe
Code: -
-
#include <GL/glut.h>
-
-
void display(void)
-
{
-
//clear all pixels
-
glClear(GL_COLOR_BUFFER_BIT);
-
-
/*draw a white polygon (rectangle) with corners at (0.25, 0.25, 0.25) and (0.75, 0.75, 0.75)*/
-
-
glColor3f(1.0, 1.0, 1.0);
-
glBegin(GL_POLYGON);
-
glVertex3f(0.25, 0.25, 0.25);
-
glVertex3f(0.75, 0.25, 0.0);
-
glVertex3f(0.75, 0.75, 0.0);
-
glVertex3f(0.25, 0.75, 0.0);
-
glEnd();
-
glFlush();
-
}
-
-
void init(void)
-
{
-
//select clearing background color
-
glClearColor(0.0, 0.0, 0.0, 0.0);
-
-
//init viewing values
-
glMatrixMode(GL_PROJECTION);
-
glLoadIdentity();
-
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
-
}
-
-
-
-
int main(int argc, char** argv)
-
{
-
-
glutInit(&argc, argv);
-
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
-
glutInitWindowSize(250, 250);
-
glutInitWindowPosition(100, 100);
-
glutCreateWindow("KILL ALL HUMANS!!!");
-
init();
-
glutDisplayFunc(display);
-
glutMainLoop();
-
return 0; /* ISO C requires main to return int */
-
}
-
5 5784
You must instruct the linker to link the glu32 and opengl32 libraries.
You must instruct the linker to link the glu32 and opengl32 libraries.
did that. i also linked it to the glut lib file
did that. i also linked it to the glut lib file
Did you also specify the paths to the libraries??
Did you also specify the paths to the libraries??
no. in properties, i just added the names.
You need to add the paths or the linker can't find the libraries.
Go to Tools->Options->Projects and Solution->VC++ Directories->Show directories-.Select Library Files
And add the path (or paths) here.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Scott Chang |
last post by:
Hi all,
I tried to use Managed C++ coding of VC++.NET (2002)and
OpenGL version 1.2 to draw a hexagon shape of benzene.
My OpenGLdrawBenzene.cpp is the following:
// This is the main project file...
|
by: Scott Chang |
last post by:
Hi All
I tried to use the attached OpenGL code to draw a Star-shaped figure on my Microsoft Visual C++ .NET 2002-Windows XP Pro PC. When I did 'Build' in Debug Mode, I got an error C2065:...
|
by: iredshift |
last post by:
Hello,
I am trying to use visual c++ express to write opengl programs for a
class because I don't have the full visual studio program. However,
when I downloaded and installed visual c++ express...
|
by: mcwooq |
last post by:
Hi,
I just installed the VS.Studio 2005 Team Edition for Developper and
encountered
severe problems with debugging ASP.NET 2.0 projects. Even newly empty
created ASP 2.0 projects can't debug...
|
by: yabansu |
last post by:
Hi all,
I implemented a basic client application. It communicates with server and works properly. Building processes succeed just by giving the following warning:
LINK : D:\DOC\Visual Studio...
|
by: thersitz |
last post by:
Hi,
I have VStudio2005, SQLServer 2005 dev edition loaded on a windowsXP Pro
machine.
I installed it ok. I just attempted to load the Personal Web Site Starter
Kit (I downloaded off...
|
by: misu101 |
last post by:
Hi,
I have a VS 6 project and I am trying to compile it using VS 2005.
My program has the atlbase.h include which seems to trigger the errors.
It used to compile OK using VS 6.
The include...
|
by: yalbizu |
last post by:
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
using namespace std;
const int NO_OF_STUDENTS=20;
struct studentType
{
string studentFName;
string studentLName;
|
by: Norman Diamond |
last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet
Framework 2. Options are set in the setup project properties, so if these
two dependencies are not already installed then...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |