Linker error

Hi, can you help me to remove this error? I created new project
A configured dependencies as so:
opengl32.lib;glu32.lib;olepro32.lib;%(AdditionalDependencies);C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\gl;

1
2
3
4
5
6
7
8
9
10
11
12
13
// OpenGL1.cpp : main project file.
// #include "stdafx.h"
#include "windows.h"
#include <GL/gl.h>
#include <iostream>

using namespace System;

int main()
{
	std::cout << "Hello World" << "\n";
    return 0;
}


This is my error:
1>------ Build started: Project: OpenGL1, Configuration: Debug Win32 ------
1> OpenGL1.cpp
1>LINK : fatal error LNK1104: cannot open file 'C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\gl.obj'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


It's not clear to me why it wants gl.obj
I am using Visual Studio C++ 2010 Express
Last edited on
It's not clear to me why it wants gl.obj
#include <GL/gl.h>

Also it looks like you are mixing c++ up with c++/cli or c# maybe with this line: using namespace System; since AFAIK c++ does not have the System namespace unless you made one or gl has one . Though c++/cli and c# have the system namespace but..they don't have the same syntax. Actually c++/cli has the same syntax I think but I am not positive I haven't ever used it but I know I have never heard of the System namespace is standard c++. But I thought c++/cli had something like System::Console::Writeline("hello, world");


Anyways your problem seems to be that you linked OpenGL wrong. http://cse.spsu.edu/jchastin/courses/cs4363/labs/ProjectSetup/Project_Setup.html
https://www.youtube.com/watch?v=YfhpVVq1Gx8
Last edited on
Thanks for your answer. When I have started new Console project, the Visual Studio created the namespace system and I left it there. I fixed the error. I think it was because I hade the directory there. This is correct:

opengl32.lib;glu32.lib;olepro32.lib;%(AdditionalDependencies);

Yes, there was created this line:
System::Console::Writeline("hello, world");
I had to changed it. I dont know why it was created managed code instead unmanaged!
Last edited on
Topic archived. No new replies allowed.