Public bug reported:

The following snippet from the official documentation fails to link:

----------------=============----------------
#include <json_spirit_reader.h>
#include <fstream>

int main() {
  std::ifstream is( "json.txt" );
  json_spirit::Value value;
  json_spirit::read( is, value );
}
----------------=============----------------

The link error is:
test.cpp:(.text+0x58): undefined reference to `json_spirit::read(std::istream&, 
json_spirit::Value_impl<json_spirit::Config_vector<std::__cxx11::basic_string<char,
 std::char_traits<char>, std::allocator<char> > > >&)'
collect2: error: ld returned 1 exit status

If I try to compile the official tests from the source package using the
installed library, they also fail to link. If I compile the source
package manually (using cmake directly) and link against the generated
.a, then everything works as expected.

I also noticed that when compiling the source package, I get a library
with size 29M, while the installed version is only 5M. Perhaps too much
stuff was stripped out?

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: libjson-spirit-dev 4.05-1.1 [modified: usr/lib/libjson_spirit.a]
ProcVersionSignature: Ubuntu 4.2.0-18.22-generic 4.2.3
Uname: Linux 4.2.0-18-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
CurrentDesktop: XFCE
Date: Fri Nov 27 09:22:05 2015
InstallationDate: Installed on 2013-11-20 (736 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
SourcePackage: json-spirit
UpgradeStatus: Upgraded to wily on 2015-11-26 (0 days ago)

** Affects: json-spirit (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug wily

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1520477

Title:
  Impossible to link any program reading from istream

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/json-spirit/+bug/1520477/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to