Package: libcgicc5-dev Version: 3.2.9-3 Severity: normal --- Please enter the report below this line. --- I'm unable to link a program which uses libcgicc if I compile the program with g++-5 ( Konsole output gcc version 5.2.1 20150903 (Debian 5.2.1-16)) or clang++-3.7 (Debian clang version 3.7.0-1 (tags/RELEASE_370/final) (based on LLVM 3.7.0))
Compiling the following example fetched from http://www.gnu.org/software/cgicc/doc/cgicc_tutorial.html Konsole output #include <iostream> #include <vector> #include <string> #include "cgicc/Cgicc.h" #include "cgicc/HTTPHTMLHeader.h" #include "cgicc/HTMLClasses.h" using namespace std; using namespace cgicc; int main(int argc, char **argv) { try { Cgicc cgi; // Send HTTP header cout << HTTPHTMLHeader() << endl; // Set up the HTML document cout << html() << head(title("cgicc example")) << endl; cout << body() << endl; // Print out the submitted element form_iterator name = cgi.getElement("name"); if(name != cgi.getElements().end()) { cout << "Your name: " << **name << endl; } // Close the HTML document cout << body() << html(); } catch(exception& e) { // handle any errors - omitted for brevity } } I get: Konsole output $ g++-5 testcgicc.cpp -o testcgicc -lcgicc /tmp/user/1000/ccLyuNZj.o: In function `main': testcgicc.cpp:(.text+0x1d8): undefined reference to `cgicc::Cgicc::getElement(std::__cxx11::basic_string<char, std::char _traits<char>, std::allocator<char> > const&)' testcgicc.cpp:(.text+0x25c): undefined reference to `cgicc::FormEntry::operator*[abi:cxx11]() const' /tmp/user/1000/ccLyuNZj.o: In function `cgicc::HTMLBooleanElement<cgicc::htmlTag>::HTMLBooleanElement()': testcgicc.cpp:(.text._ZN5cgicc18HTMLBooleanElementINS_7htmlTagEEC2Ev[_ZN5cgicc18HTMLBooleanElementINS_7htmlTagEEC5Ev]+0x 29): undefined reference to `cgicc::HTMLElement::HTMLElement(cgicc::HTMLAttributeList const*, cgicc::HTMLElement const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, cgicc::HTMLElement::EElementTyp e)' /tmp/user/1000/ccLyuNZj.o: In function `cgicc::HTMLBooleanElement<cgicc::titleTag>::HTMLBooleanElement(std::__cxx11::bas ic_string<char, std::char_traits<char>, std::allocator<char> > const&)': testcgicc.cpp:(.text._ZN5cgicc18HTMLBooleanElementINS_8titleTagEEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcE EE[_ZN5cgicc18HTMLBooleanElementINS_8titleTagEEC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2f): undefin ed reference to `cgicc::HTMLElement::HTMLElement(cgicc::HTMLAttributeList const*, cgicc::HTMLElement const*, std::__cxx1 1::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, cgicc::HTMLElement::EElementType)' /tmp/user/1000/ccLyuNZj.o: In function `cgicc::HTMLBooleanElement<cgicc::headTag>::HTMLBooleanElement(cgicc::HTMLElement const&)': testcgicc.cpp:(.text._ZN5cgicc18HTMLBooleanElementINS_7headTagEEC2ERKNS_11HTMLElementE[_ZN5cgicc18HTMLBooleanElementINS_ 7headTagEEC5ERKNS_11HTMLElementE]+0x2c): undefined reference to `cgicc::HTMLElement::HTMLElement(cgicc::HTMLAttributeLis t const*, cgicc::HTMLElement const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > con st*, cgicc::HTMLElement::EElementType)' /tmp/user/1000/ccLyuNZj.o: In function `cgicc::HTMLBooleanElement<cgicc::bodyTag>::HTMLBooleanElement()': testcgicc.cpp:(.text._ZN5cgicc18HTMLBooleanElementINS_7bodyTagEEC2Ev[_ZN5cgicc18HTMLBooleanElementINS_7bodyTagEEC5Ev]+0x 29): undefined reference to `cgicc::HTMLElement::HTMLElement(cgicc::HTMLAttributeList const*, cgicc::HTMLElement const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, cgicc::HTMLElement::EElementTyp e)' collect2: error: ld returned 1 exit status --- System information. --- Architecture: amd64 Kernel: Linux 4.1.0-2-amd64 Debian Release: stretch/sid 900 unstable ftp.se.debian.org 900 unstable deb-multimedia.org 800 testing security.debian.org 800 testing ftp.se.debian.org 800 testing deb-multimedia.org 60 stable silk.apana.org.au 60 stable security.debian.org 60 stable repository.spotify.com 60 stable packages.x2go.org 60 stable ftp.se.debian.org 60 stable dl.google.com 60 stable deb-multimedia.org 500 precise ppa.launchpad.net 500 jessie linux.dropbox.com 500 intrepid ppa.launchpad.net 49 experimental ftp.se.debian.org --- Package information. --- Depends (Version) | Installed =========================-+-============ libcgicc5 (= 3.2.9-3) | 3.2.9-3 Package's Recommends field is empty. Suggests (Version) | Installed ===========================-+-=========== libcgicc-doc |