因为现在的项目转移到了 Linux 平台下,并且 IPC 通信使用了 DBus,第一次在 Linux 下进行编程,编译和链接 DBus 的程序。果然几乎是每一步很困难,所有东西都需要查资料。习惯了 IDE 下的工作,转到 Command line 就像个废人一样。

程序本身已经在上篇文章帖出来了(My_Client.cpp, My_Server.cpp),这没有什么,和 Windows 上一样。

编译需要用的 makefile ,边查边写,写了个最简单的:

  • Server: DBusServerTest.o
  •     gcc DBusServerTest.o -o Server -ldbus-1 -lstdc++
  •  
  • DBusServerTest.o: DBusServerTest.cpp
  •     gcc -c DBusServerTest.cpp -g -o DBusServerTest.o -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
  •  
  • clean:
  •     rm -rf *.o Server
  • 相关文章:

    • 2021-12-31
    • 2022-12-23
    • 2021-07-14
    • 2021-10-08
    • 2022-01-16
    • 2023-02-04
    • 2021-10-25
    猜你喜欢
    • 2022-12-23
    • 2021-12-19
    • 2021-06-28
    • 2021-11-19
    • 2021-08-18
    • 2021-11-21
    • 2022-01-08
    相关资源
    相似解决方案