{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2026","repository_url":"https://api.github.com/repos/Microsoft/vscode-cpptools","labels_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2026/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2026/comments","events_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2026/events","html_url":"https://github.com/Microsoft/vscode-cpptools/issues/2026","id":325142791,"number":2026,"title":"Problem while compiling with external libraries.","user":{"login":"Horsetaur","id":37443683,"avatar_url":"https://avatars1.githubusercontent.com/u/37443683?v=4","gravatar_id":"","url":"https://api.github.com/users/Horsetaur","html_url":"https://github.com/Horsetaur","followers_url":"https://api.github.com/users/Horsetaur/followers","following_url":"https://api.github.com/users/Horsetaur/following{/other_user}","gists_url":"https://api.github.com/users/Horsetaur/gists{/gist_id}","starred_url":"https://api.github.com/users/Horsetaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Horsetaur/subscriptions","organizations_url":"https://api.github.com/users/Horsetaur/orgs","repos_url":"https://api.github.com/users/Horsetaur/repos","events_url":"https://api.github.com/users/Horsetaur/events{/privacy}","received_events_url":"https://api.github.com/users/Horsetaur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-05-22T05:09:39Z","updated_at":"2018-05-22T19:35:49Z","closed_at":null,"author_association":"NONE","body":"So I have trouble compiling this code:\r\n\r\n    #include <GL/gl.h>\r\n    #include <GL/glu.h>\r\n    #include <GLFW/glfw3.h>\r\n    #include <iostream>\r\n\r\n     using namespace std;\r\n\r\n\r\n        int main( int argc, char * argv[] )\r\n        {\r\n            GLFWwindow* window = glfwCreateWindow(800, 600, \"LearnOpenGL\", NULL, NULL);\r\n            if (window == NULL)\r\n            {\r\n                std::cout << \"Failed to create GLFW window\" << std::endl;\r\n                glfwTerminate();\r\n                return -1;\r\n            }\r\n            glfwMakeContextCurrent(window);\r\n        }\r\n\r\n\r\nIt gives me:\r\n\r\n    Executing task: g++ -g -lopengl32 -lglu32 -lglfw3 main.cpp <\r\n    C:\\Users\\damia\\AppData\\Local\\Temp\\ccSvn9zL.o: In function `main':\r\n    B:\\REPO\\c++/main.cpp:11: undefined reference to `glfwCreateWindow'\r\n    B:\\REPO\\c++/main.cpp:15: undefined reference to `glfwTerminate'\r\n    B:\\REPO\\c++/main.cpp:18: undefined reference to `glfwMakeContextCurrent'\r\n    collect2.exe: error: ld returned 1 exit status\r\n    The terminal process terminated with exit code: 1\r\n\r\n    Terminal will be reused by tasks, press any key to close it.\r\n\r\nAnd here are the \r\n<b>tasks.json: </b>\r\n\r\n    {\r\n        \"version\": \"2.0.0\",\r\n        \"tasks\": [\r\n            {\r\n                \"label\": \"echo\",\r\n                \"type\": \"shell\",\r\n                \"command\": \"g++\",\r\n                \"args\": [\r\n                    \"-g\",\"-lopengl32\", \"-lglu32\",\"-lglfw3\",\"main.cpp\"\r\n                ],\r\n                \"group\": {\r\n                    \"kind\": \"build\",\r\n                    \"isDefault\": true\r\n                }\r\n            }\r\n        ]\r\n    }\r\nand <b>c_cpp_properties.json:</b>\r\n\r\n    {\r\n        \"configurations\": [\r\n            {\r\n                \"name\": \"Win32\",\r\n                \"browse\": {\r\n                    \"path\": [\r\n                        \"${workspaceFolder}\",\r\n                        \"B:\\\\MinGW\\\\lib\",\r\n                        \"B:\\\\MinGW\\\\lib\\\\gcc\\\\mingw32\\\\6.3.0\",\r\n                        \"B:\\\\MinGW\\\\lib\\\\gcc\\\\mingw32\\\\6.3.0\\\\include\\\\c++\"\r\n                    ],\r\n                    \"limitSymbolsToIncludedHeaders\": true\r\n                },\r\n                \"includePath\": [\r\n                    \"${workspaceFolder}/**\",\r\n                    \"B:\\\\MinGW\\\\include\"\r\n                ],\r\n                \"defines\": [\r\n                    \"_DEBUG\",\r\n                    \"UNICODE\",\r\n                    \"_UNICODE\"\r\n                ],\r\n                \"compilerPath\": \"B:\\\\MinGW\\\\bin\\\\gcc.exe\",\r\n                \"cStandard\": \"c11\",\r\n                \"cppStandard\": \"c++17\",\r\n                \"intelliSenseMode\": \"clang-x64\"\r\n            }\r\n        ],\r\n        \"version\": 4\r\n    }\r\n\r\nHow to make this work ?"},"comment":{"url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/comments/391114383","html_url":"https://github.com/Microsoft/vscode-cpptools/issues/2026#issuecomment-391114383","issue_url":"https://api.github.com/repos/Microsoft/vscode-cpptools/issues/2026","id":391114383,"user":{"login":"Borderliner","id":2098879,"avatar_url":"https://avatars2.githubusercontent.com/u/2098879?v=4","gravatar_id":"","url":"https://api.github.com/users/Borderliner","html_url":"https://github.com/Borderliner","followers_url":"https://api.github.com/users/Borderliner/followers","following_url":"https://api.github.com/users/Borderliner/following{/other_user}","gists_url":"https://api.github.com/users/Borderliner/gists{/gist_id}","starred_url":"https://api.github.com/users/Borderliner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Borderliner/subscriptions","organizations_url":"https://api.github.com/users/Borderliner/orgs","repos_url":"https://api.github.com/users/Borderliner/repos","events_url":"https://api.github.com/users/Borderliner/events{/privacy}","received_events_url":"https://api.github.com/users/Borderliner/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T19:35:49Z","updated_at":"2018-05-22T19:35:49Z","author_association":"NONE","body":"`-l` and `-L` are different. `-l` specifies the name of the library, `-L` specifies the path to the library. Generally, you specify `-L/path/to/lib` and then `-lmylib`."}}
{"actor":{"display_login":"Borderliner"}}