{"action":"opened","number":28,"pull_request":{"url":"https://api.github.com/repos/MmgTools/mmg/pulls/28","id":217539034,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NTM5MDM0","html_url":"https://github.com/MmgTools/mmg/pull/28","diff_url":"https://github.com/MmgTools/mmg/pull/28.diff","patch_url":"https://github.com/MmgTools/mmg/pull/28.patch","issue_url":"https://api.github.com/repos/MmgTools/mmg/issues/28","number":28,"state":"open","locked":false,"title":"Fix linking error.","user":{"login":"jdumas","id":578702,"node_id":"MDQ6VXNlcjU3ODcwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/578702?v=4","gravatar_id":"","url":"https://api.github.com/users/jdumas","html_url":"https://github.com/jdumas","followers_url":"https://api.github.com/users/jdumas/followers","following_url":"https://api.github.com/users/jdumas/following{/other_user}","gists_url":"https://api.github.com/users/jdumas/gists{/gist_id}","starred_url":"https://api.github.com/users/jdumas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdumas/subscriptions","organizations_url":"https://api.github.com/users/jdumas/orgs","repos_url":"https://api.github.com/users/jdumas/repos","events_url":"https://api.github.com/users/jdumas/events{/privacy}","received_events_url":"https://api.github.com/users/jdumas/received_events","type":"User","site_admin":false},"body":"This is related to [this thread](https://forum.mmgtools.org/t/multiple-definition-error-linking/200).\r\n\r\nTo reproduce the problem, create a minimal project with 2 different files including mmg:\r\n\r\n#### `foo.cpp`\r\n```cpp\r\n#include <mmg/libmmg.h>\r\n```\r\n\r\n#### `main.cpp`\r\n```cpp\r\n#include <mmg/libmmg.h>\r\n\r\nint main(void) {\r\n\treturn 0;\r\n}\r\n```\r\n\r\n#### `CMakeLists.txt`\r\n```cpp\r\ncmake_minimum_required(VERSION 3.1)\r\nproject(example)\r\n\r\nadd_subdirectory(mmg)\r\n\r\nadd_executable(example foo.cpp main.cpp)\r\ntarget_link_libraries(example libmmg3d_a)\r\n```\r\n\r\nWill produce the following linking error:\r\n```\r\n/usr/bin/ld: CMakeFiles/example.dir/main.cpp.o:(.bss+0x0): multiple definition of `MMG3D_lenedgCoor'; CMakeFiles/example.dir/foo.cpp.o:(.bss+0x0): first defined here\r\ncollect2: error: ld returned 1 exit status\r\nmake[2]: *** [CMakeFiles/example.dir/build.make:101: example] Error 1\r\nmake[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/example.dir/all] Error 2\r\nmake: *** [Makefile:152: all] Error 2\r\n```","created_at":"2018-09-24T00:03:47Z","updated_at":"2018-09-24T00:03:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/MmgTools/mmg/pulls/28/commits","review_comments_url":"https://api.github.com/repos/MmgTools/mmg/pulls/28/comments","review_comment_url":"https://api.github.com/repos/MmgTools/mmg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MmgTools/mmg/issues/28/comments","statuses_url":"https://api.github.com/repos/MmgTools/mmg/statuses/834512fd74be768b8d978754eb64c6cacd5dd520","head":{"label":"jdumas:master","ref":"master","sha":"834512fd74be768b8d978754eb64c6cacd5dd520","user":{"login":"jdumas","id":578702,"node_id":"MDQ6VXNlcjU3ODcwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/578702?v=4","gravatar_id":"","url":"https://api.github.com/users/jdumas","html_url":"https://github.com/jdumas","followers_url":"https://api.github.com/users/jdumas/followers","following_url":"https://api.github.com/users/jdumas/following{/other_user}","gists_url":"https://api.github.com/users/jdumas/gists{/gist_id}","starred_url":"https://api.github.com/users/jdumas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdumas/subscriptions","organizations_url":"https://api.github.com/users/jdumas/orgs","repos_url":"https://api.github.com/users/jdumas/repos","events_url":"https://api.github.com/users/jdumas/events{/privacy}","received_events_url":"https://api.github.com/users/jdumas/received_events","type":"User","site_admin":false},"repo":{"id":136852856,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY4NTI4NTY=","name":"mmg","full_name":"jdumas/mmg","private":false,"owner":{"login":"jdumas","id":578702,"node_id":"MDQ6VXNlcjU3ODcwMg==","avatar_url":"https://avatars1.githubusercontent.com/u/578702?v=4","gravatar_id":"","url":"https://api.github.com/users/jdumas","html_url":"https://github.com/jdumas","followers_url":"https://api.github.com/users/jdumas/followers","following_url":"https://api.github.com/users/jdumas/following{/other_user}","gists_url":"https://api.github.com/users/jdumas/gists{/gist_id}","starred_url":"https://api.github.com/users/jdumas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdumas/subscriptions","organizations_url":"https://api.github.com/users/jdumas/orgs","repos_url":"https://api.github.com/users/jdumas/repos","events_url":"https://api.github.com/users/jdumas/events{/privacy}","received_events_url":"https://api.github.com/users/jdumas/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jdumas/mmg","description":"open source software for bidimensional and tridimensional remeshing","fork":true,"url":"https://api.github.com/repos/jdumas/mmg","forks_url":"https://api.github.com/repos/jdumas/mmg/forks","keys_url":"https://api.github.com/repos/jdumas/mmg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdumas/mmg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdumas/mmg/teams","hooks_url":"https://api.github.com/repos/jdumas/mmg/hooks","issue_events_url":"https://api.github.com/repos/jdumas/mmg/issues/events{/number}","events_url":"https://api.github.com/repos/jdumas/mmg/events","assignees_url":"https://api.github.com/repos/jdumas/mmg/assignees{/user}","branches_url":"https://api.github.com/repos/jdumas/mmg/branches{/branch}","tags_url":"https://api.github.com/repos/jdumas/mmg/tags","blobs_url":"https://api.github.com/repos/jdumas/mmg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdumas/mmg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdumas/mmg/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdumas/mmg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdumas/mmg/statuses/{sha}","languages_url":"https://api.github.com/repos/jdumas/mmg/languages","stargazers_url":"https://api.github.com/repos/jdumas/mmg/stargazers","contributors_url":"https://api.github.com/repos/jdumas/mmg/contributors","subscribers_url":"https://api.github.com/repos/jdumas/mmg/subscribers","subscription_url":"https://api.github.com/repos/jdumas/mmg/subscription","commits_url":"https://api.github.com/repos/jdumas/mmg/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdumas/mmg/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdumas/mmg/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdumas/mmg/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdumas/mmg/contents/{+path}","compare_url":"https://api.github.com/repos/jdumas/mmg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdumas/mmg/merges","archive_url":"https://api.github.com/repos/jdumas/mmg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdumas/mmg/downloads","issues_url":"https://api.github.com/repos/jdumas/mmg/issues{/number}","pulls_url":"https://api.github.com/repos/jdumas/mmg/pulls{/number}","milestones_url":"https://api.github.com/repos/jdumas/mmg/milestones{/number}","notifications_url":"https://api.github.com/repos/jdumas/mmg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdumas/mmg/labels{/name}","releases_url":"https://api.github.com/repos/jdumas/mmg/releases{/id}","deployments_url":"https://api.github.com/repos/jdumas/mmg/deployments","created_at":"2018-06-10T23:34:49Z","updated_at":"2018-09-23T23:59:36Z","pushed_at":"2018-09-23T23:59:35Z","git_url":"git://github.com/jdumas/mmg.git","ssh_url":"git@github.com:jdumas/mmg.git","clone_url":"https://github.com/jdumas/mmg.git","svn_url":"https://github.com/jdumas/mmg","homepage":"http://www.mmgtools.org","size":20115,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MmgTools:master","ref":"master","sha":"e83ef9fd3e489239f056af7bc2b5d265a1147d23","user":{"login":"MmgTools","id":11387951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMzg3OTUx","avatar_url":"https://avatars1.githubusercontent.com/u/11387951?v=4","gravatar_id":"","url":"https://api.github.com/users/MmgTools","html_url":"https://github.com/MmgTools","followers_url":"https://api.github.com/users/MmgTools/followers","following_url":"https://api.github.com/users/MmgTools/following{/other_user}","gists_url":"https://api.github.com/users/MmgTools/gists{/gist_id}","starred_url":"https://api.github.com/users/MmgTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MmgTools/subscriptions","organizations_url":"https://api.github.com/users/MmgTools/orgs","repos_url":"https://api.github.com/users/MmgTools/repos","events_url":"https://api.github.com/users/MmgTools/events{/privacy}","received_events_url":"https://api.github.com/users/MmgTools/received_events","type":"Organization","site_admin":false},"repo":{"id":32025808,"node_id":"MDEwOlJlcG9zaXRvcnkzMjAyNTgwOA==","name":"mmg","full_name":"MmgTools/mmg","private":false,"owner":{"login":"MmgTools","id":11387951,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMzg3OTUx","avatar_url":"https://avatars1.githubusercontent.com/u/11387951?v=4","gravatar_id":"","url":"https://api.github.com/users/MmgTools","html_url":"https://github.com/MmgTools","followers_url":"https://api.github.com/users/MmgTools/followers","following_url":"https://api.github.com/users/MmgTools/following{/other_user}","gists_url":"https://api.github.com/users/MmgTools/gists{/gist_id}","starred_url":"https://api.github.com/users/MmgTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MmgTools/subscriptions","organizations_url":"https://api.github.com/users/MmgTools/orgs","repos_url":"https://api.github.com/users/MmgTools/repos","events_url":"https://api.github.com/users/MmgTools/events{/privacy}","received_events_url":"https://api.github.com/users/MmgTools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/MmgTools/mmg","description":"open source software for bidimensional and tridimensional remeshing","fork":false,"url":"https://api.github.com/repos/MmgTools/mmg","forks_url":"https://api.github.com/repos/MmgTools/mmg/forks","keys_url":"https://api.github.com/repos/MmgTools/mmg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MmgTools/mmg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MmgTools/mmg/teams","hooks_url":"https://api.github.com/repos/MmgTools/mmg/hooks","issue_events_url":"https://api.github.com/repos/MmgTools/mmg/issues/events{/number}","events_url":"https://api.github.com/repos/MmgTools/mmg/events","assignees_url":"https://api.github.com/repos/MmgTools/mmg/assignees{/user}","branches_url":"https://api.github.com/repos/MmgTools/mmg/branches{/branch}","tags_url":"https://api.github.com/repos/MmgTools/mmg/tags","blobs_url":"https://api.github.com/repos/MmgTools/mmg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MmgTools/mmg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MmgTools/mmg/git/refs{/sha}","trees_url":"https://api.github.com/repos/MmgTools/mmg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MmgTools/mmg/statuses/{sha}","languages_url":"https://api.github.com/repos/MmgTools/mmg/languages","stargazers_url":"https://api.github.com/repos/MmgTools/mmg/stargazers","contributors_url":"https://api.github.com/repos/MmgTools/mmg/contributors","subscribers_url":"https://api.github.com/repos/MmgTools/mmg/subscribers","subscription_url":"https://api.github.com/repos/MmgTools/mmg/subscription","commits_url":"https://api.github.com/repos/MmgTools/mmg/commits{/sha}","git_commits_url":"https://api.github.com/repos/MmgTools/mmg/git/commits{/sha}","comments_url":"https://api.github.com/repos/MmgTools/mmg/comments{/number}","issue_comment_url":"https://api.github.com/repos/MmgTools/mmg/issues/comments{/number}","contents_url":"https://api.github.com/repos/MmgTools/mmg/contents/{+path}","compare_url":"https://api.github.com/repos/MmgTools/mmg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MmgTools/mmg/merges","archive_url":"https://api.github.com/repos/MmgTools/mmg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MmgTools/mmg/downloads","issues_url":"https://api.github.com/repos/MmgTools/mmg/issues{/number}","pulls_url":"https://api.github.com/repos/MmgTools/mmg/pulls{/number}","milestones_url":"https://api.github.com/repos/MmgTools/mmg/milestones{/number}","notifications_url":"https://api.github.com/repos/MmgTools/mmg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MmgTools/mmg/labels{/name}","releases_url":"https://api.github.com/repos/MmgTools/mmg/releases{/id}","deployments_url":"https://api.github.com/repos/MmgTools/mmg/deployments","created_at":"2015-03-11T15:38:21Z","updated_at":"2018-09-03T18:08:15Z","pushed_at":"2018-09-11T07:15:49Z","git_url":"git://github.com/MmgTools/mmg.git","ssh_url":"git@github.com:MmgTools/mmg.git","clone_url":"https://github.com/MmgTools/mmg.git","svn_url":"https://github.com/MmgTools/mmg","homepage":"http://www.mmgtools.org","size":22301,"stargazers_count":45,"watchers_count":45,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":29,"open_issues":2,"watchers":45,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MmgTools/mmg/pulls/28"},"html":{"href":"https://github.com/MmgTools/mmg/pull/28"},"issue":{"href":"https://api.github.com/repos/MmgTools/mmg/issues/28"},"comments":{"href":"https://api.github.com/repos/MmgTools/mmg/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/MmgTools/mmg/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/MmgTools/mmg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MmgTools/mmg/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/MmgTools/mmg/statuses/834512fd74be768b8d978754eb64c6cacd5dd520"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":4,"deletions":1,"changed_files":2}}
{"actor":{"display_login":"jdumas"}}