question

YRK-33345 avatar image
0 Votes"
YRK-33345 asked JeanineZhang-MSFT commented

cannot open file 'soil2-debug.lib

I'm trying to create an opengl window with c ++ but I encounter this error "cannot open file 'soil2-debug.lib'" (I added the folder to linker> general)

That's the code

 #include "libs.h"
    
 int main ()
 {
 glfwInit ();
    
    
 const int WINDOW_WIDTH = 640;
 const int WINDOW_HEIGHT = 480;
 int FramebufferWidth = 0;
 int FramebufferHeight = 0;
    
    
 glfwWindowHint (GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
 glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 4);
 glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 4);
 glfwWindowHint (GLFW_RESIZABLE, GLFW_FALSE);
 glfwWindowHint (GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
    
    
 GLFWwindow * window = glfwCreateWindow (WINDOW_WIDTH, WINDOW_HEIGHT, "Yairk_bit", NULL, NULL);
    
    
 glfwGetFramebufferSize (window, & FramebufferWidth, & FramebufferHeight);
 glViewport (0, 0, FramebufferWidth, FramebufferHeight);
    
 glfwMakeContextCurrent (window);
    
 glewExperimental = GL_TRUE;
    
 if (glewInit ()! = GLEW_OK)
 {
 std :: cout << "ERR :: main.cpp :: GlewInit Faild" << "\ n";
 glfwTerminate ();
 }
    
 while (! glfwWindowShouldClose (window))
 {
    
 }
    
 glfwTerminate ();
    
    
    
 return 0;
 }
c++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JeanineZhang-MSFT avatar image
0 Votes"
JeanineZhang-MSFT answered JeanineZhang-MSFT commented

Hi,

As far as I'm concerned, you should add the path to the .lib file to the Additional Library Directories (property -> linker -> General -> Additional Library Directories). I suggest you check if the path of .lib is correct.

And make sure in Visual Studio you are always adding the paths to all your configurations (Debug/Release).

Best Regards,

Jeanine



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@YRK-33345

May I know if you have got any chance to check my answer? I am glad to help if you have any other questions.

0 Votes 0 ·