Menu

#149 Build in cygwin error: '::asprintf' has not been declared

Feature Request
open
nobody
5
4 days ago
2017-10-08
dinostray
No

In cygwin(x64), I run the following command:

./configure --build=x86_64-pc-cygwin
make

then I get the error:
PThreads.cpp:22:16: error: '::asprintf' has not been declared
int size = ::asprintf(&buff_alloc, "%lu", pthread_self()); // thread id unsigned

I got info from:
https://ubuntuforums.org/showthread.php?t=279801
Then I know I should define _GNU_SOURCE first

Discussion

  • dinostray

    dinostray - 2017-10-09

    By the way, If I didn't use --build=x86_64-pc-cygwin, the ./configure command will get error.

     
  • Alexander Perepelkin

    By the way, If I didn't use --build=x86_64-pc-cygwin, the ./configure command will get error.

    Something like
    configure: error: cannot guess build type; you must specify one
    I guess?

     

    Last edit: Alexander Perepelkin 2017-10-10
  • Alexander Perepelkin

    Then I know I should define _GNU_SOURCE first

    I tried to build in cygwin just now and didn't experienced any errors.
    It must be cygwin-specific.

    Thanks for this report. It just seems to me that this definition of _GNU_SOURCE
    should be put either into build script, or one of include/log4cpp/config*.h files

     
  • Alexander Perepelkin

    Autotools are updated with commit https://sourceforge.net/p/log4cpp/codegit/ci/99bf327fed032073cb6e3e5f5b19e4f8005a54b2/ , x86_64-pc-cygwin configuration is included.
    Passing the option explicitly like you mentioned:

    ./configure --build=x86_64-pc-cygwin
    

    is not required anymore

    This simple command should suffice:

    ./configure
    make
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.