链接错误:未定义对"avahi_alternative_service_name"的引用
Linking error : undefined reference to `avahi_alternative_service_name'
知道我需要在库中找到这个符号。我正在尝试编译基于 avahi 的测试代码以查看服务。但我越来越undefined reference to
avahi_alternative_service_name''。我不知道哪个库包含这个,我正在运行 UBUNTU 12.04。我尝试安装几个软件包,但没有成功。任何想法谢谢。。
我安装了以下软件包
dpkg --get-selections | grep avahi
avahi-autoipd install
avahi-daemon install
avahi-utils install
libavahi-cil-dev install
libavahi-client-dev install
libavahi-client3 install
libavahi-client3:i386 install
libavahi-common-data install
libavahi-common-data:i386 install
libavahi-common-dev install
libavahi-common3 install
libavahi-common3:i386 install
libavahi-core7 install
libavahi-glib-dev install
libavahi-glib1 install
libavahi-gobject0 install
libavahi-ui-dev install
libavahi-ui-gtk3-0 install
libavahi-ui0 install
libavahi1.0-cil install
命令
gcc -fpermissive testAvahi.c -o testAvahi
实际上需要找到库,然后需要将它们传递给链接器,所以 follwing 命令确实对我
有用
gcc -fpermissive testAvahi.c -o testAvahi -L/usr/lib/x86_64-linux-gnu/ -lavahi-client -lavahi-common
如果你有一个放置 C++ 库的公共文件夹,你可以使用 nm 命令检查搜索函数类似的东西
cd /usr/lib
nm -AC * | grep avahi_alternative_service_name
nm 实用程序在 binutils(sudo apt-get install binutils) 中可用
相关文章:
- Boost.Spirit Alternative Parser parallelization
- Windows Service 可以枚举桌面顶级窗口吗?
- Alternative to wcsncpy_s
- bad_weak_ptr使用从 boost::asio::io_context::service 继承的类
- C++ API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL依赖项问题
- 是否可以使用C /WinRT创建Windows Service应用程序
- std::launder alternative pre c++17
- Alternative to timegm on Solaris
- 内存效率高 map<pair<int,int>, set<int>> alternative
- WaitForMultipleObjects alternative with std::thread?
- Windows Service 无法调用 C++ 本机方法 [DllImpor( "myDLL" )]
- Win32 alternative to pthread
- QStringList alternative in STL or Boost
- CIN and COUT alternative to QT
- windows service SIGSEGV
- Singleton Service classes in c++
- 使用 alternative 变量声明更改 for 循环的范围:
- 来自 MSDN 的 InternetGetConnectedState 和"it should not be used from a service"声明
- C++ in the cloud. Casablanca REST Service on Microsoft Azure
- C++98 alternative to std::stoul?