sdp-cpp icon indicating copy to clipboard operation
sdp-cpp copied to clipboard

build tests/parser.cpp failed with undefined reference

Open chinuno-usami opened this issue 5 years ago • 2 comments

build libsdp-cpp.so with

make -f Makefile CONF=Release

and compile parser.cpp with

g++ -I./include -L./dist/Release/GNU-Linux tests/parser.cpp -lsdp-cpp

outputs

/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_private::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_hostport::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_glonass::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_mediaclock::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_fsrate::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_gps::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ntp::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_avb_stream_id::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_sender::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_domain_dgts::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_version::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_EUI64::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_filter_mode::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_timestamp_refclk_attr::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_server::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_media_clksrc_attr::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_domain_name::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_domain_n1::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_clksrc_ext::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_local::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_mediaclock_param_name::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_source_filter_attr::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_domain_char::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ieee1722_streamid::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_mediaclock_param_value::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_gal::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_domain_nmbr::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_clksrc_param_value::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_domain_n3::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_media_clktag::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_filter_spec::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_gmid::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_version_ext::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_src_list::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_domain_n2::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_address_types::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_clksrc_param_name::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ntp_server_addr::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_clksrc::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_dest_address::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_direct::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_mediaclock_ext::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_ptp_domain::parse(abnf::ParserContext&)'
/usr/bin/ld: ./dist/Debug/GNU-Linux/libsdp-cpp.so: undefined reference to `abnf::Rule_media_clkid::parse(abnf::ParserContext&)'
collect2: 错误:ld 返回 1
nm -D dist/Release/GNU-Linux/libsdp-cpp.so  |grep Rule_media_clkid

outputs

                 U _ZN4abnf16Rule_media_clkid5parseERNS_13ParserContextE
000000000014d9b0 T _ZN7Builder5visitEPN4abnf16Rule_media_clkidE

it seems does not contain some of implementation in .so file

chinuno-usami avatar Aug 13 '20 11:08 chinuno-usami

The missing references refer to files that have not been compiled in. At a minimum you need to modify Makefile-Release.mk and add each of them to OBJECTFILES and to the Build Targets. By the looks of it the makefiles have not been updated for a long time.

cmd00 avatar Oct 01 '20 08:10 cmd00

i have the same error....

krsvital avatar Nov 05 '20 02:11 krsvital