【问题标题】:linux getpid System call errorlinux getpid 系统调用错误
【发布时间】:2016-01-16 04:02:40
【问题描述】:

尝试在 linux-mint 上运行 c++ prog 时出现 htis 错误, $ 制作

g++ -c -O3  common.cc   
common.cc: In function ‘float getCurrentMemoryUsage()’:
common.cc:11:40: error: ‘getpid’ was not declared in this scope
  string pid = intToStr(unsigned(getpid()));

解决此问题的步骤是什么,在此先感谢。

【问题讨论】:

标签: c++ linux kernel


【解决方案1】:

来自getpid(3) man page

SYNOPSIS
       #include <unistd.h>

【讨论】:

    猜你喜欢
    • 2021-07-29
    • 2020-05-18
    • 2017-06-24
    • 2010-11-06
    • 2012-06-30
    • 1970-01-01
    • 1970-01-01
    • 2016-05-12
    • 2016-03-02
    相关资源
    最近更新 更多