2

so i don't know a lot for VS2015 i downlode it because i want to use it in my University to use OpenGL so i have this problem and i didn't fine any way to fix it

first of all i install the program in disk D: i have made a project in C and D and got the same problem i try to run it without debug and without cod

"Severity Code Description Project File Line Suppression State Error LNK1104 cannot open file 'ucrtd.lib' ConsoleApplication2 D:\Users\Anmar\documents\visual studio 2015\Projects\ConsoleApplication2\ConsoleApplication2\LINK 1
" this is photo for the problem when i add some code and run it http://screencast.com/t/znmUrht6vyg

the code was

#include <glut.h>

void display()
{
    glClear(GL_COLOR_BUFFER_BIT);

    glColor3f(1.0, 0.0, 0.0);
    glBegin(GL_POLYGON);
    glVertex2f(-0.5, -0.5);
    glVertex2f(-0.5, 0.5);
    glVertex2f(0.5, 0.5);
    glVertex2f(0.5, -0.5);
    glEnd();

    glFlush();
}
int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glClearColor(1.0, 1.0, 1.0, 0.0);
    glutDisplayFunc(display);
    glutMainLoop();
}

so any way to fix this ?

Anmar Mashat
  • 33
  • 1
  • 9

1 Answers1

4

I think your question may be similar to this one:

How to I update my C++ project in Visual Studio 2015 to use the new Universal CRT?

I had to do a couple things to get older C++ projects to work with VS2015.

First, I had to make sure I installed MFC as part of VS2015.

Second, I needed to add to my LibraryPath, for my 32-bit project:

$(UniversalCRT_LibraryPath_x86)

So now my vcxproj file has this for its LibraryPath

<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\WinDDK\7600.16385.1\lib\wxp\i386;$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir_71A)lib;$(UniversalCRT_LibraryPath_x86)</LibraryPath>

Third, I had to refresh my understanding of the variety of C Run-Time libraries with VS2015, since they have changed a little bit. Here's the link to CRT Library Features on MSDN, which explains how all the switches affect what in VS2015:

https://msdn.microsoft.com/en-us/library/abx4dbyh.aspx

Some of my vcxproj switches were mismatched with what MSDN said. It took a little effort to get them all straightened out.

Then I realized I had only done my Debug configuration. I had to also make all the changes all over again to my Release configuration. Good safety tip.

Hope that helps!

Community
  • 1
  • 1
Eljay
  • 4,648
  • 3
  • 16
  • 27