简体   繁体   中英

cannot find syslog.h on windows

I am rewriting ac program which was used to linux, now I'll reused it on windows, I write a bat file. I run this file as administrator, then error occurs: syslog.h:No such file or directory.

Could you please give me some advices? thx.

Probably the program you are porting to windows uses the syslog(3) function call (in addition to openlog and closelog). These are defined in syslog.h on unix. Windows does not have these, so you can do the following:

  • Remove syslog.h and these function calls from the code.
  • Create a syslog.h and implement these calls or just define them as empty macros.
  • Use cygwin which provides POSIX compatibility.

Windows doesn't offer a built-in syslog client. You may be able to use a third-party library, such as http://syslog-win32.sourceforge.net .

In PHP source code you can find a wrapper based on Windows function ReportEvent() .

Eg: take a look at wsyslog.c and syslog.h

Edit: have you tried syslog-server ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM