Date: Mon, 23 Apr 2007 01:54:47 +0400 From: "Andrew Pantyukhin" <infofarmer@FreeBSD.org> To: hackers@freebsd.org Subject: extern "C" and undefined reference Message-ID: <cb5206420704221454v60a957b9qac74dc5f4f4b674a@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
7zip developers converted some code from C++ to C, while leaving the main stand-alone lzma app in C++. They use 'extern "C" { }' blocks around #include's referencing C headers. Everything compiles fine, but "undefined reference" errors appear at linkage. The undefined references are to the C functions included from withing those 'extern "C"' wrappers. I tried to remove the wrappers from some files and the amount of errors decreased a bit. Is there a better workaround? Google came up with two results: remove the wrappers or use c++ instead of cc. I'm already using c++. Thanks!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cb5206420704221454v60a957b9qac74dc5f4f4b674a>