{"action":"closed","issue":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/3570","repository_url":"https://api.github.com/repos/libgit2/libgit2","labels_url":"https://api.github.com/repos/libgit2/libgit2/issues/3570/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/3570/comments","events_url":"https://api.github.com/repos/libgit2/libgit2/issues/3570/events","html_url":"https://github.com/libgit2/libgit2/issues/3570","id":125430731,"number":3570,"title":"winhttp Multiple Definition Errors under MinGW","user":{"login":"deathssoul","id":13917597,"avatar_url":"https://avatars.githubusercontent.com/u/13917597?v=3","gravatar_id":"","url":"https://api.github.com/users/deathssoul","html_url":"https://github.com/deathssoul","followers_url":"https://api.github.com/users/deathssoul/followers","following_url":"https://api.github.com/users/deathssoul/following{/other_user}","gists_url":"https://api.github.com/users/deathssoul/gists{/gist_id}","starred_url":"https://api.github.com/users/deathssoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deathssoul/subscriptions","organizations_url":"https://api.github.com/users/deathssoul/orgs","repos_url":"https://api.github.com/users/deathssoul/repos","events_url":"https://api.github.com/users/deathssoul/events{/privacy}","received_events_url":"https://api.github.com/users/deathssoul/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-07T16:37:32Z","updated_at":"2016-02-05T17:37:41Z","closed_at":"2016-02-05T17:37:41Z","body":"Using a freshly cloned copy of libgit2 and the 0.23.4 tag, I get the following error when I try to compile a static executable using a static build of libgit2 and a static build of wxWidgets 3.0.2:\r\n```\r\n/home/User/Code/boss/lib/libgit2.a(winhttp.c.obj):winhttp.c:(.rdata+0x810): multiple definition of `IID_IInternetSecurityManager'\r\n/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libuuid.a(lib64_libuuid_a-dxva-uuid.o):(.rdata$IID_IInternetSecurityManager[IID_IInternetSecurityManager]+0x0): first defined here\r\n/home/User/Code/boss/lib/libgit2.a(winhttp.c.obj):winhttp.c:(.rdata+0x820): multiple definition of `CLSID_InternetSecurityManager'\r\n/usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libuuid.a(lib64_libuuid_a-uuid.o):(.rdata$CLSID_InternetSecurityManager[CLSID_InternetSecurityManager]+0x0): first defined here\r\ncollect2: error: ld returned 1 exit status\r\nCMakeFiles/boss_gui.dir/build.make:640: recipe for target 'boss_gui.exe' failed\r\nmake[2]: *** [boss_gui.exe] Error 1\r\nCMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/boss_gui.dir/all' failed\r\nmake[1]: *** [CMakeFiles/boss_gui.dir/all] Error 2\r\nMakefile:83: recipe for target 'all' failed\r\nmake: *** [all] Error 2\r\n```\r\nChanging \r\n```c++\r\nconst CLSID CLSID_InternetSecurityManager = { 0x7B8A2D94, 0x0AC9, 0x11D1,\r\n\t{ 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4 } };\r\n```\r\nto\r\n```c++\r\nstatic const CLSID CLSID_InternetSecurityManager = { 0x7B8A2D94, 0x0AC9, 0x11D1,\r\n\t{ 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4 } };\r\n```\r\nbrought up this error:\r\n```\r\n/home/User/Code/libgit2/src/transports/winhttp.c:55:20: error: static declaration of 'CLSID_InternetSecurityManager' follows non-static declaration\r\n static const CLSID CLSID_InternetSecurityManager = { 0x7B8A2D94, 0x0AC9, 0x11D1\r\n                    ^\r\nIn file included from /home/User/Code/libgit2/deps/winhttp/urlmon.h:43:0,\r\n                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/objbase.h:163,\r\n                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/ole2.h:17,\r\n                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/wtypes.h:12,\r\n                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/winscard.h:10,\r\n                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/windows.h:97,\r\n                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:23,\r\n                 from /home/User/Code/libgit2/src/common.h:39,\r\n                 from /home/User/Code/libgit2/src/buffer.h:10,\r\n                 from /home/User/Code/libgit2/src/transports/winhttp.c:12:\r\n/usr/x86_64-w64-mingw32/sys-root/mingw/include/urlmon.h:7348:20: note: previous declaration of 'CLSID_InternetSecurityManager' was here\r\n EXTERN_C const IID CLSID_InternetSecurityManager;\r\n                    ^\r\n/home/User/Code/libgit2/src/transports/winhttp.c: In function 'certificate_check':\r\n/home/User/Code/libgit2/src/transports/winhttp.c:234:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]\r\n  error = t->owner->certificate_check_cb((git_cert *) &cert, valid, t->connectio\r\n  ^\r\n/home/User/Code/libgit2/src/transports/winhttp.c: In function 'write_chunk':\r\n/home/User/Code/libgit2/src/transports/winhttp.c:493:23: warning: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'size_t {aka long long unsigned int}' [-Wformat=]\r\n  git_buf_printf(&buf, \"%X\\r\\n\", len);\r\n                       ^\r\nCMakeFiles/git2.dir/build.make:2968: recipe for target 'CMakeFiles/git2.dir/src/transports/winhttp.c.obj' failed\r\nmake[2]: *** [CMakeFiles/git2.dir/src/transports/winhttp.c.obj] Error 1\r\nCMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/git2.dir/all' failed\r\nmake[1]: *** [CMakeFiles/git2.dir/all] Error 2\r\nMakefile:127: recipe for target 'all' failed\r\nmake: *** [all] Error 2\r\n```\r\n\r\nThe codebase I'm working on doesn't actually use those symbols and only occurs with wxWidgets in the mix, without the GUI it works fine."}}