Bug 362033 - undeclared identifier build failures for getpid(), usleep(), and getuid()
Summary: undeclared identifier build failures for getpid(), usleep(), and getuid()
Status: RESOLVED UNMAINTAINED
Alias: None
Product: valkyrie
Classification: Unmaintained
Component: general (show other bugs)
Version: 2.0.0
Platform: Other macOS
: NOR normal
Target Milestone: ---
Assignee: Cerion Armour-Brown
URL: https://github.com/Homebrew/homebrew-...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-21 12:33 UTC by ilovezfs
Modified: 2018-09-04 16:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ilovezfs 2016-04-21 12:33:22 UTC
All of the following is resolved by including unistd.h in src/utils/vk_utils.h (though there may be other possible solutions):

```
compiling moc/moc_opt_le_widget.cpp
compiling moc/moc_mainwindow.cpp
utils/vk_utils.cpp:54:76: error: use of undeclared identifier 'getpid'
   fprintf( stdout, "===%s:%d=== ", qPrintable( VkCfg::appName() ), ( int )getpid() );
                                                                           ^
utils/vk_utils.cpp:68:76: error: use of undeclared identifier 'getpid'
   fprintf( stderr, "===%s:%d=== ", qPrintable( VkCfg::appName() ), ( int )getpid() );
                                                                           ^
utils/vk_utils.cpp:83:76: error: use of undeclared identifier 'getpid'
   fprintf( stderr, "===%s:%d=== ", qPrintable( VkCfg::appName() ), ( int )getpid() );
                                                                           ^
3 errors generated.
make[1]: *** [obj/vk_utils.o] Error 1
make[1]: *** Waiting for unfinished jobs....
objects/tool_object.cpp:391:7: error: use of undeclared identifier 'usleep'
      usleep( WAIT_VG_START_SLEEP * 1000 );
      ^
objects/tool_object.cpp:474:13: error: use of undeclared identifier 'usleep'
            usleep( 1000 * sleepDuration );
            ^
utils/vk_config.cpp:125:18: error: use of undeclared identifier 'getuid'
      pid_t me = getuid();
                 ^
2 errors generated.
make[1]: *** [obj/tool_object.o] Error 1
1 error generated.
make[1]: *** [obj/vk_config.o] Error 1
make: *** [sub-src-install_subtargets] Error 2
/usr/local/Library/Homebrew/debrew.rb:11:in `raise'
BuildError: Failed executing: make install
```

Reproducible: Always

Steps to Reproduce:
1. try to build on OS X 10.11 El Capitan (possibly lower too)
2.
3.

Actual Results:  
build fails

Expected Results:  
build succeeds

+    inreplace "src/utils/vk_utils.h", "#include <iostream>",
+                                      "#include <iostream>\n#include <unistd.h>"

patches the problem.
Comment 1 Andrew Crouthamel 2018-09-04 16:05:40 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I am closing this bug.