Some distros (like Ubuntu since 11.10) use "ld --as-needed" by default which causes gcc (spawned by znc-buildmod) to ignore ${LIBS}. A simple fix is to move ${LIBS} after the name of the file to be compiled.
Be careful about the order of the parameters when using gcc; the -l option is a linker option, and thus needs to be placed AFTER the name of the file to be compiled. This is quite different from the normal option syntax. If you place the -l option before the filename, it may fail to link at all, and you can end up with mysterious errors.
Some distros (like Ubuntu since 11.10) use "ld --as-needed" by default which causes gcc (spawned by znc-buildmod) to ignore ${LIBS}. A simple fix is to move ${LIBS} after the name of the file to be compiled.
``` bash
${CXX} ${CXXFLAGS} ${INCLUDES} ${LDFLAGS} ${MODLINK} -o "${MOD}.so" "${FILE}" ${LIBS}
```
> Be careful about the order of the parameters when using gcc; the -l option is a linker option, and thus needs to be placed AFTER the name of the file to be compiled. This is quite different from the normal option syntax. If you place the -l option before the filename, it may fail to link at all, and you can end up with mysterious errors.
http://tldp.org/HOWTO/Program-Library-HOWTO/static-libraries.html
http://stackoverflow.com/questions/7824439/c-math-linker-problems-on-ubuntu-11-10
<!-- github-sync-id:5778834 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Some distros (like Ubuntu since 11.10) use "ld --as-needed" by default which causes gcc (spawned by znc-buildmod) to ignore ${LIBS}. A simple fix is to move ${LIBS} after the name of the file to be compiled.
http://tldp.org/HOWTO/Program-Library-HOWTO/static-libraries.html
http://stackoverflow.com/questions/7824439/c-math-linker-problems-on-ubuntu-11-10