{"action":"created","issue":{"url":"https://api.github.com/repos/nzbget/nzbget/issues/188","repository_url":"https://api.github.com/repos/nzbget/nzbget","labels_url":"https://api.github.com/repos/nzbget/nzbget/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/nzbget/nzbget/issues/188/comments","events_url":"https://api.github.com/repos/nzbget/nzbget/issues/188/events","html_url":"https://github.com/nzbget/nzbget/issues/188","id":142125206,"number":188,"title":"Linking fails with ncurses built with separate tinfo (termlib) ","user":{"login":"sbraz","id":4833332,"avatar_url":"https://avatars.githubusercontent.com/u/4833332?v=3","gravatar_id":"","url":"https://api.github.com/users/sbraz","html_url":"https://github.com/sbraz","followers_url":"https://api.github.com/users/sbraz/followers","following_url":"https://api.github.com/users/sbraz/following{/other_user}","gists_url":"https://api.github.com/users/sbraz/gists{/gist_id}","starred_url":"https://api.github.com/users/sbraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbraz/subscriptions","organizations_url":"https://api.github.com/users/sbraz/orgs","repos_url":"https://api.github.com/users/sbraz/repos","events_url":"https://api.github.com/users/sbraz/events{/privacy}","received_events_url":"https://api.github.com/users/sbraz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-20T03:32:36Z","updated_at":"2016-03-20T16:40:25Z","closed_at":null,"body":"On systems where ncurses was built with  `--with-termlib`, linking fails because of a missing `-ltinfo` library. Here is the result when trying to compile latest git version:\r\n```\r\ng++ -std=gnu++14  -g -O2  -L/usr/lib -L/usr/lib -o nzbget Connection.o TlsSocket.o WebDownloader.o FeedScript.o NzbScript.o PostScript.o QueueScript.o ScanScript.o SchedulerScript.o ScriptConfig.o FeedCoordinator.o FeedFile.o FeedFilter.o FeedInfo.o ColoredFrontend.o Frontend.o LoggableFrontend.o NCursesFrontend.o CommandLineParser.o DiskService.o Maintenance.o nzbget.o Options.o Scheduler.o StackTrace.o ArticleDownloader.o ArticleWriter.o Decoder.o NewsServer.o NntpConnection.o ServerPool.o StatMeter.o Cleanup.o DupeMatcher.o ParChecker.o ParCoordinator.o ParParser.o ParRenamer.o PrePostProcessor.o Unpack.o DiskState.o DownloadInfo.o DupeCoordinator.o HistoryCoordinator.o NzbFile.o QueueCoordinator.o QueueEditor.o Scanner.o UrlCoordinator.o BinRpc.o RemoteClient.o RemoteServer.o WebServer.o XmlRpc.o Log.o NString.o Observer.o Script.o Thread.o Service.o FileSystem.o Util.o code_revision.o commandline.o crc.o creatorpacket.o criticalpacket.o datablock.o descriptionpacket.o diskfile.o filechecksummer.o galois.o mainpacket.o md5.o par2creatorsourcefile.o par2fileformat.o par2repairer.o par2repairersourcefile.o parheaders.o recoverypacket.o reedsolomon.o verificationhashtable.o verificationpacket.o   -lz -lncurses -lpthread  -lxml2 -lssl -lcrypto\r\n/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: NCursesFrontend.o: undefined reference to symbol 'nodelay'\r\n/lib64/libtinfo.so.6: error adding symbols: DSO missing from command line\r\ncollect2: error: ld returned 1 exit status\r\nMakefile:920: recipe for target 'nzbget' failed\r\nmake[1]: *** [nzbget] Error 1\r\nmake[1]: Leaving directory '/tmp/nzbget'\r\nMakefile:824: recipe for target 'all' failed\r\nmake: *** [all] Error 2\r\n```\r\nGentoo has been using pkg-config to obtain the right libraries. Here is the original bug: https://bugs.gentoo.org/show_bug.cgi?id=527262 and the patch is the following:\r\n```diff\r\ndiff --git a/configure.ac b/configure.ac\r\nindex 96cb50b..beb5838 100644\r\n--- a/configure.ac\r\n+++ b/configure.ac\r\n@@ -46,6 +46,7 @@ AC_PATH_PROG(TAR, tar, $FALSE)\r\n AC_PATH_PROG(MAKE, make, $FALSE)\r\n AC_PROG_INSTALL\r\n \r\n+PKG_PROG_PKG_CONFIG()\r\n \r\n dnl\r\n dnl Do all tests with c++ compiler.\r\n@@ -306,6 +307,7 @@ if test \"$USECURSES\" = \"yes\"; then\r\n        if test \"$FOUND\" = \"no\"; then\r\n                AC_MSG_ERROR([Couldn't find curses headers (ncurses.h or curses.h)])\r\n        fi\r\n+       PKG_CHECK_MODULES(ncurses,ncurses,LIBS=\"$LIBS $ncurses_LIBS\",)\r\n        AC_SEARCH_LIBS([refresh], [ncurses curses],, \r\n                AC_ERROR([Couldn't find curses library]))\r\n else\r\n```"},"comment":{"url":"https://api.github.com/repos/nzbget/nzbget/issues/comments/198960482","html_url":"https://github.com/nzbget/nzbget/issues/188#issuecomment-198960482","issue_url":"https://api.github.com/repos/nzbget/nzbget/issues/188","id":198960482,"user":{"login":"SoapGentoo","id":16636962,"avatar_url":"https://avatars.githubusercontent.com/u/16636962?v=3","gravatar_id":"","url":"https://api.github.com/users/SoapGentoo","html_url":"https://github.com/SoapGentoo","followers_url":"https://api.github.com/users/SoapGentoo/followers","following_url":"https://api.github.com/users/SoapGentoo/following{/other_user}","gists_url":"https://api.github.com/users/SoapGentoo/gists{/gist_id}","starred_url":"https://api.github.com/users/SoapGentoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SoapGentoo/subscriptions","organizations_url":"https://api.github.com/users/SoapGentoo/orgs","repos_url":"https://api.github.com/users/SoapGentoo/repos","events_url":"https://api.github.com/users/SoapGentoo/events{/privacy}","received_events_url":"https://api.github.com/users/SoapGentoo/received_events","type":"User","site_admin":false},"created_at":"2016-03-20T16:40:25Z","updated_at":"2016-03-20T16:40:25Z","body":"Hi @hugbug , @SoapGentoo from Gentoo here: why do you prefer sticking to `AC_SEARCH_LIBS`? In general, pkg-config should always be preferred, as you can't forsee dependency changes down the road (as was the case with tinfo)."}}