IBMStreams / streamsx.json

Toolkit for working with JSON in SPL applications.
http://ibmstreams.github.io/streamsx.json/
Other
3 stars 19 forks source link

C++ compilation failures when fusing operators that use the toJSON functions. #68

Closed ddebrunner closed 7 years ago

ddebrunner commented 8 years ago

This SPL will fail to compile:

use com.ibm.streamsx.json::toJSON;

public composite FuseJson {
   graph
     () as A = Custom() {
      logic state: rstring a = toJSON("a", 3) + toJSON("b", "4");
     }
     () as B = Custom() {
      logic state: rstring a = toJSON("a", true) + toJSON("b", "4");
     }
   config placement: partitionColocation("AB");
}
ddebrunner commented 8 years ago

Sample error

     [exec] build/operator/B.o: In function `char const* com::ibm::streamsx::json::convToChars<SPL::ustring>(SPL::ustring const&)':
     [exec] B.cpp:(.text+0x0): multiple definition of `char const* com::ibm::streamsx::json::convToChars<SPL::ustring>(SPL::ustring const&)'
     [exec] build/operator/A.o:A.cpp:(.text+0x0): first defined here
     [exec] build/operator/B.o: In function `char const* com::ibm::streamsx::json::convToChars<SPL::ConstValueHandle>(SPL::ConstValueHandle const&)':
ddebrunner commented 8 years ago

Functions should all be declared in-line:

http://stackoverflow.com/questions/1759300/when-should-i-write-the-keyword-inline-for-a-function-method