Bug #2252

Projects fail to build due to missing "RSTSTABLE_EXPORT"

Added by M. Goerlich almost 9 years ago. Updated almost 9 years ago.

Status:RejectedStart date:05/06/2015
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:cpp
Target version:Robotics Service Bus - rsb-0.13

Description

Hey,

I just upgraded to 0.12 and found this error in my CMake projects (rsb included through pkg-config: PKG_CHECK_MODULES(LIBS REQUIRED opencv rsc0.12 rsb0.12 rst0.12 ...) ).
Changing some names to RST_EXPORT makes these errors disappear. It seems like the CXX_FLAGS contain RST_EXPORT somehow.

/media/local_data/sports_sys_local/releases/nightly/releases/trusty/lsp-csra-nightly/include/rst0.12/stable/rst/generic/Value.pb.h:49:1: error: ‘RSTSTABLE_EXPORT’ does not name a type
 RSTSTABLE_EXPORT bool Value_Type_IsValid(int value);
 ^
/media/local_data/sports_sys_local/releases/nightly/releases/trusty/lsp-csra-nightly/include/rst0.12/stable/rst/generic/Value.pb.h:54:1: error: ‘RSTSTABLE_EXPORT’ does not name a type
 RSTSTABLE_EXPORT const ::google::protobuf::EnumDescriptor* Value_Type_descriptor();
 ^
/media/local_data/sports_sys_local/releases/nightly/releases/trusty/lsp-csra-nightly/include/rst0.12/stable/rst/generic/Value.pb.h: In function ‘const string& rst::generic::Value_Type_Name(rst::generic::Value_Type)’:
/media/local_data/sports_sys_local/releases/nightly/releases/trusty/lsp-csra-nightly/include/rst0.12/stable/rst/generic/Value.pb.h:57:27: error: ‘Value_Type_descriptor’ was not declared in this scope
     Value_Type_descriptor(), value);
                           ^
/media/local_data/sports_sys_local/releases/nightly/releases/trusty/lsp-csra-nightly/include/rst0.12/stable/rst/generic/Value.pb.h: In function ‘bool rst::generic::Value_Type_Parse(const string&, rst::generic::Value_Type*)’:
/media/local_data/sports_sys_local/releases/nightly/releases/trusty/lsp-csra-nightly/include/rst0.12/stable/rst/generic/Value.pb.h:62:27: error: ‘Value_Type_descriptor’ was not declared in this scope
     Value_Type_descriptor(), name, value);
                           ^
/media/local_data/sports_sys_local/releases/nightly/releases/trusty/lsp-csra-nightly/include/rst0.12/stable/rst/generic/Value.pb.h: At global scope:
/media/local_data/sports_sys_local/releases/nightly/releases/trusty/lsp-csra-nightly/include/rst0.12/stable/rst/generic/Value.pb.h:66:30: error: expected initializer before ‘:’ token
 class RSTSTABLE_EXPORT Value : public ::google::protobuf::Message {

Btw: I just switched to the CMake-Version of finding libraries and it works fine.

History

#1 Updated by J. Wienke almost 9 years ago

I can't see how this should happen. In any case, pkg-config or cmake, you need to export the cflags provided by the dependency mechanism. Both should export RSTSTABLE_EXPORT correctly. Otherwise something is messed up in the installation. On master and csra master the CMakeLists.txt defines:

IF(WIN32)
    SET(RST_CFLAGS "/DRSTSTABLE_EXPORT=__declspec(dllimport)")
    SET(RSTSANDBOX_CFLAGS "/DRSTSANDBOX_EXPORT=__declspec(dllimport)")
    SET(RSTDEPRECATED_CFLAGS "/DRSTDEPRECATED_EXPORT=__declspec(dllimport)")
ELSE()
    SET(RST_CFLAGS "-DRSTSTABLE_EXPORT=")
    SET(RSTSANDBOX_CFLAGS "-DRSTSANDBOX_EXPORT=")
    SET(RSTDEPRECATED_CFLAGS "-DRSTDEPRECATED_EXPORT=")
ENDIF()

and the respective pkg-config file is configured from:

Cflags: -I${includedir}/@INSTALL_PREFIX@/stable @RST_CFLAGS@

So either you grabbed an old version of a pkg-config file from ancient times or something is weird. Please show the Cflags provided by pkg-config for you.

#2 Updated by J. Wienke almost 9 years ago

  • Category set to cpp
  • Target version set to rsb-0.13

#3 Updated by M. Goerlich almost 9 years ago

  • Status changed from New to Rejected
  • % Done changed from 0 to 100

Okay it seems like the way cmake handles pkg-config files is kind of broken, giving semicolon-separated lists for Cflags. Switching to CMake is a better solution.

Also available in: Atom PDF