Results 1 to 4 of 4

Thread: A linker error

  1. #1
    Junior Member
    Join Date
    Sep 2017
    Posts
    8

    A linker error

    Hi all,

    Using Visual Studio 2017 I created an Empty Project named opengl. Then tested the code in the page 40 of the book "OpenGL.Programming.Guide.9th.Edition", Example1.1:

    Code :
    #include <iostream>
    using namespace std;
    #include "vgl.h"
    #include "LoadShaders.h"
     
    enum VAO_IDs { Triangles, NumVAOs };
    enum Buffer_IDs { ArrayBuffer, NumBuffers };
    enum Attrib_IDs { vPosition = 0 };
    GLuint VAOs[NumVAOs];
    GLuint Buffers[NumBuffers];
    const GLuint NumVertices = 6;
    //--------------------------------------------------------------------
    //
    // init
    //
    void
    init(void)
    {
    	static const GLfloat vertices[NumVertices][2] =
    	{
    		{ -0.90, -0.90 }, // Triangle 1
    		{ 0.85, -0.90 },
    		{ -0.90, 0.85 },
    		{ 0.90, -0.85 }, // Triangle 2
    		{ 0.90, 0.90 },
    		{ -0.85, 0.90 }
    	};
    	glCreateBuffers(NumBuffers, Buffers);
    	glNamedBufferStorage(Buffers[ArrayBuffer], sizeof(vertices),
    		vertices, 0);
    	ShaderInfo shaders[] = {
    		{ GL_VERTEX_SHADER, "triangles.vert" },
    		{ GL_FRAGMENT_SHADER, "triangles.frag" },
    		{ GL_NONE, NULL }
    	};
    	GLuint program = LoadShaders(shaders);
    	glUseProgram(program);
    	glGenVertexArrays(NumVAOs, VAOs);
    	glBindVertexArray(VAOs[Triangles]);
    	glBindBuffer(GL_ARRAY_BUFFER, Buffers[ArrayBuffer]);
    	glVertexAttribPointer(vPosition, 2, GL_FLOAT,
    		GL_FALSE, 0, BUFFER_OFFSET(0));
    	glEnableVertexAttribArray(vPosition);
    }
    //--------------------------------------------------------------------
    //
    // display
    //
    void
    display(void)
    {
    	static const float black[] = { 0.0f, 0.0f, 0.0f, 0.0f };
    	glClearBufferfv(GL_COLOR, 0, black);
    	glBindVertexArray(VAOs[Triangles]);
    	glDrawArrays(GL_TRIANGLES, 0, NumVertices);
    }
    //--------------------------------------------------------------------
    //
    // main
    //
    int
    main(int argc, char** argv)
    {
    	glfwInit();
    	GLFWwindow* window = glfwCreateWindow(640, 480, "Triangles", NULL,
    		NULL);
    	glfwMakeContextCurrent(window);
    	gl3wInit();
    	init();
     
    	while (!glfwWindowShouldClose(window))
    	{
    		display();
    		glfwSwapBuffers(window);
    		glfwPollEvents();
    	}
     
    	glfwDestroyWindow(window);
    	glfwTerminate();
    }

    When I compile it, it needs a lib file named: "glfw3_d.lib"
    Where to find it please?

  2. #2
    Junior Member
    Join Date
    Sep 2017
    Posts
    8
    Do you read that book?
    ?Have your tested that code on your VS?

  3. #3
    Administrator khronos's Avatar
    Join Date
    Jun 2002
    Location
    Montreal
    Posts
    86
    A quick google came up with this. No idea if it is what you need or not, but might be helpful:

    https://github.com/openglsuperbible/...HOWTOBUILD.txt

  4. #4
    We have made a new major release (2.1) It contains all features and bugfixes of the git master branch from 28th October. A partial list of new stuff is below:
    - aecho filter
    - perspective filter ported from libmpcodecs
    - ffprobe -show_programs option
    - compand filter
    - RTMP seek support
    - when transcoding with ffmpeg (i.e. not streamcopying), -ss is now accurate
    even when used as an input option. Previous behavior can be restored with
    the -noaccurate_seek option.
    - ffmpeg -t option can now be used for inputs, to limit the duration of
    data read from an input file
    - incomplete Voxware MetaSound decoder
    - read EXIF metadata from JPEG
    - DVB teletext decoder
    - phase filter ported from libmpcodecs
    - w3fdif filter
    - Opus support in Matroska
    - FFV1 version 1.3 is stable and no longer experimental
    - FFV1: YUVA(444,422,420) 9, 10 and 16 bit support
    - changed DTS stream id in lavf mpeg ps muxer from 0x8a to 0x88, to be
    more consistent with other muxers.
    - adelay filter
    - pullup filter ported from libmpcodecs
    - ffprobe -read_intervals option
    - Lossless and alpha support for WebP decoder
    - Error Resilient AAC syntax (ER AAC LC) decoding
    - Low Delay AAC (ER AAC LD) decoding
    - mux chapters in ASF files
    - SFTP protocol (via libssh)
    - libx264: add ability to encode in YUVJ422P and YUVJ444P
    - Fraps: use BT.709 colorspace by default for yuv, as reference fraps decoder does
    - make decoding alpha optional for prores, ffv1 and vp6 by setting
    the skip_alpha flag.
    - ladspa wrapper filter
    - native VP9 decoder
    - dpx parser
    - max_error_rate parameter in ffmpeg
    - PulseAudio output device
    - ReplayGain scanner
    - Enhanced Low Delay AAC (ER AAC ELD) decoding (no LD SBR support)
    - Linux framebuffer output device
    - HEVC decoder, raw HEVC demuxer, HEVC demuxing in TS, Matroska and MP4
    - mergeplanes filter
    for more information about web design go to http://www.parsaya.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean