[test] Qt: Use _putenv_s instead of setenv on Windows builds #10899

pull brianmcmichael wants to merge 1 commits into bitcoin:master from brianmcmichael:testfix changing 1 files +5 −1
  1. brianmcmichael commented at 9:28 pm on July 21, 2017: contributor

    Fixes #10836

    Error message I would get on make:

     0...
     1  CXXLD    bench/bench_bitcoin.exe
     2  OBJCXXLD qt/bitcoin-qt.exe
     3qt/test/test_main.cpp: In function ‘int main(int, char**)’:
     4qt/test/test_main.cpp:64:43: error: ‘setenv’ was not declared in this scope
     5     setenv("QT_QPA_PLATFORM", "minimal", 0);
     6                                           ^
     7make[2]: *** [qt/test/qt_test_test_bitcoin_qt-test_main.o] Error 1
     8make[2]: *** Waiting for unfinished jobs....
     9make[2]: Leaving directory `/home/bmcmichael/Projects/bcoin/src'
    10make[1]: *** [all-recursive] Error 1
    11make[1]: Leaving directory `/home/bmcmichael/Projects/bcoin/src'
    12make: *** [all-recursive] Error 1
    

    setenv function is not available from the Microsoft runtime library. Need to use _putenv_s instead.

    This solution tells the compiler to use _putenv_s on WIN32 compilation (Note: this also works on 64-bit Windows instances.) and setenv everywhere else.

    I’ve tested builds on Windows 10 x64 and Ubuntu 16.04 with this code.

  2. Qt: Use _putenv_s instead of setenv on Windows builds 0be03c71bd
  3. fanquake added the label Tests on Jul 21, 2017
  4. fanquake added the label Windows on Jul 21, 2017
  5. laanwj commented at 12:36 pm on July 24, 2017: member
    utACK
  6. TheBlueMatt commented at 6:41 pm on July 25, 2017: member
    utACK
  7. MarcoFalke renamed this:
    Qt: Use _putenv_s instead of setenv on Windows builds
    [test] Qt: Use _putenv_s instead of setenv on Windows builds
    on Jul 25, 2017
  8. MarcoFalke added this to the milestone 0.15.0 on Jul 25, 2017
  9. MarcoFalke commented at 9:51 pm on July 25, 2017: member
    utACK 0be03c71bd91db25f30bcf4d45facf1e26dcfd30
  10. laanwj merged this on Jul 26, 2017
  11. laanwj closed this on Jul 26, 2017

  12. laanwj referenced this in commit f29d5dbd04 on Jul 26, 2017
  13. PastaPastaPasta referenced this in commit 59ee64c6a8 on May 6, 2019
  14. PastaPastaPasta referenced this in commit fc1b3772d5 on May 6, 2019
  15. barrystyle referenced this in commit fbc438d1c4 on Jan 22, 2020
  16. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 10:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me