{"action":"created","issue":{"url":"https://api.github.com/repos/actsl/kiss_sdl/issues/4","repository_url":"https://api.github.com/repos/actsl/kiss_sdl","labels_url":"https://api.github.com/repos/actsl/kiss_sdl/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/actsl/kiss_sdl/issues/4/comments","events_url":"https://api.github.com/repos/actsl/kiss_sdl/issues/4/events","html_url":"https://github.com/actsl/kiss_sdl/issues/4","id":156553544,"number":4,"title":"Undefined symbols for x86 - KISS 0.10.6 (sorry!)","user":{"login":"AVividLight","id":6750062,"avatar_url":"https://avatars.githubusercontent.com/u/6750062?v=3","gravatar_id":"","url":"https://api.github.com/users/AVividLight","html_url":"https://github.com/AVividLight","followers_url":"https://api.github.com/users/AVividLight/followers","following_url":"https://api.github.com/users/AVividLight/following{/other_user}","gists_url":"https://api.github.com/users/AVividLight/gists{/gist_id}","starred_url":"https://api.github.com/users/AVividLight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AVividLight/subscriptions","organizations_url":"https://api.github.com/users/AVividLight/orgs","repos_url":"https://api.github.com/users/AVividLight/repos","events_url":"https://api.github.com/users/AVividLight/events{/privacy}","received_events_url":"https://api.github.com/users/AVividLight/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"actsl","id":17134083,"avatar_url":"https://avatars.githubusercontent.com/u/17134083?v=3","gravatar_id":"","url":"https://api.github.com/users/actsl","html_url":"https://github.com/actsl","followers_url":"https://api.github.com/users/actsl/followers","following_url":"https://api.github.com/users/actsl/following{/other_user}","gists_url":"https://api.github.com/users/actsl/gists{/gist_id}","starred_url":"https://api.github.com/users/actsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actsl/subscriptions","organizations_url":"https://api.github.com/users/actsl/orgs","repos_url":"https://api.github.com/users/actsl/repos","events_url":"https://api.github.com/users/actsl/events{/privacy}","received_events_url":"https://api.github.com/users/actsl/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-05-24T16:34:44Z","updated_at":"2016-05-25T18:01:12Z","closed_at":null,"body":"Hello!\r\n\r\nSorry for creating another issue here, I hope I'm not becoming bothersome! After upgrading my test project to the latest version of KISS_SDL, 0.10.6, I'm seeing undefined linker errors. Specifically, the following.\r\n\r\n```\r\nUndefined symbols for architecture x86_64:\r\n  \"kiss_clean(kiss_array*)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_array_new(kiss_array*)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_label_new(kiss_label*, kiss_window*, char*, int, int)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_button_new(kiss_button*, kiss_window*, char*, int, int)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_label_draw(kiss_label*, SDL_Renderer*)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_window_new(kiss_window*, kiss_window*, int, int, int, int, int)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_button_draw(kiss_button*, SDL_Renderer*)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_window_draw(kiss_window*, SDL_Renderer*)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_button_event(kiss_button*, SDL_Event*, int*)\", referenced from:\r\n      button_event(kiss_button*, SDL_Event*, int*, int*) in main.cpp.o\r\n  \"kiss_window_event(kiss_window*, SDL_Event*, int*)\", referenced from:\r\n      _main in main.cpp.o\r\n  \"kiss_init(char*, kiss_array*, int, int)\", referenced from:\r\n      _main in main.cpp.o\r\nld: symbol(s) not found for architecture x86_64\r\n```\r\n\r\nIn my main.cpp, changing\r\n```\r\n#include \"kiss_sdl.h\r\n```\r\nto\r\n```\r\nextern \"C\" {\r\n#include \"kiss_sdl.h\"\r\n}\r\n```\r\n\r\nfixes the issues, and the project then builds, links, and runs as expected. Adding the following back to the header fixed this for me.\r\n```\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n...\r\n\r\n#ifdef __cplusplus\r\n};\r\n#endif\r\n```\r\n\r\nHere's a [pull request](https://github.com/actsl/kiss_sdl/pull/5) to add the above definition back to kiss_sdl.h, but please ignore it if there are better ways!\r\n\r\nSorry for creating so many issues! Please let me know if you'd appreciate some radio silence, or if I need to learn a bit more about how to use my compiler, or something. Thank you for the support!"},"comment":{"url":"https://api.github.com/repos/actsl/kiss_sdl/issues/comments/221656726","html_url":"https://github.com/actsl/kiss_sdl/issues/4#issuecomment-221656726","issue_url":"https://api.github.com/repos/actsl/kiss_sdl/issues/4","id":221656726,"user":{"login":"actsl","id":17134083,"avatar_url":"https://avatars.githubusercontent.com/u/17134083?v=3","gravatar_id":"","url":"https://api.github.com/users/actsl","html_url":"https://github.com/actsl","followers_url":"https://api.github.com/users/actsl/followers","following_url":"https://api.github.com/users/actsl/following{/other_user}","gists_url":"https://api.github.com/users/actsl/gists{/gist_id}","starred_url":"https://api.github.com/users/actsl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/actsl/subscriptions","organizations_url":"https://api.github.com/users/actsl/orgs","repos_url":"https://api.github.com/users/actsl/repos","events_url":"https://api.github.com/users/actsl/events{/privacy}","received_events_url":"https://api.github.com/users/actsl/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T18:01:12Z","updated_at":"2016-05-25T18:01:12Z","body":"OK, i used the extern \"C\" now, as this is how it is considered to be correct. Couldn't use the pull request though, as it is not entirely correct.\r\n\r\nHowever, with extern \"C\", a C compiler compiling the c file as C++, this is not consistent, they add features that are against the rules.\r\n\r\nThe new version of kiss_sdl 0.10.8, with improved using with C++. is now in GitHub.\r\n\r\nWith CMake, only the file's extension c or cpp, determines what compiler it uses. For the files with an extension c, it uses a C compiler, and for the files with an extension cpp, it uses a C++ compiler.\r\n\r\nWith that new version, your test project with CMake builds and runs well. However, this statement in CMakeLists.txt\r\n\r\n`add_definitions(-DRESDIR=\\\"../../resources/\\\")`\r\n\r\nis not correct, as you now have resources in ./resources, and executable in ./bin, thus one directory up and one down, not two directories up. You have also source files in ./include, which is not correct, only *.h files should be in the include directory. With that it however works. But the statement above has to be replaced with that one\r\n\r\n`add_definitions(-DRESDIR=\\\"../resources/\\\")`\r\n\r\nAnd then it works.\r\n"}}
{"actor":{"display_login":"actsl"}}