How do I link GLFW

后端 未结 2 1758
慢半拍i
慢半拍i 2021-01-24 02:11

I am trying to link GLFW to my C program.

The docs seem to suggest #include however I have installed 2.7.2 (from my distro\'s repository

2条回答
  •  不知归路
    2021-01-24 02:34

    You are mixing up compilation and linking. If you were missing headers, you would probably have errors a lot sooner than the linking stage.

    "Undefined reference" results from symbols not being found by the linker. The most likely cause is you not telling gcc that it should link to the GLFW libraries:

     gcc myfile.c -lglfw
    

提交回复
热议问题