VC驿站

 找回密码
 加入驿站

QQ登录

只需一步,快速开始

搜索
查看: 3510|回复: 3

[求助] 关于libgen.h这个库

[复制链接]
34_avatar_middle
online_vip 发表于 2016-1-5 18:37:30 | 显示全部楼层 |阅读模式
3驿站币
最近想移植一个Linux下的东西到Windows上。

看到源码里,有这个libgen.h。

搜索了相关资料后发现这个库是Linux/MAC下带的。

请问坛子里有人碰到过类似的问题吗?

请问这个库现在是Linux下的,如何才能够在Windows下来使用呢?





上一篇:客户端的工作过多,驱动程序的 SQLSetConnectAttr 失败
下一篇:很菜的问题,请大家讲解一下,谢谢
51_avatar_middle
online_admins 发表于 2016-1-5 22:37:44 | 显示全部楼层
  1. /*
  2. * Copyright (C) 2008 The Android Open Source Project
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. *  * Redistributions of source code must retain the above copyright
  9. *    notice, this list of conditions and the following disclaimer.
  10. *  * Redistributions in binary form must reproduce the above copyright
  11. *    notice, this list of conditions and the following disclaimer in
  12. *    the documentation and/or other materials provided with the
  13. *    distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  18. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  19. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  20. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  21. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  22. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  23. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  25. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  26. * SUCH DAMAGE.
  27. */
  28. #ifndef _LIBGEN_H
  29. #define _LIBGEN_H

  30. #include <sys/cdefs.h>
  31. #include <sys/types.h>

  32. __BEGIN_DECLS

  33. /* our version of dirname/basename don't modify the input path */
  34. extern char*  dirname (const char*  path);
  35. extern char*  basename(const char*  path);

  36. /* special thread-safe Bionic versions
  37. *
  38. * if 'buffer' is NULL, 'bufflen' is ignored and the length of the result is returned
  39. * otherwise, place result in 'buffer'
  40. *
  41. * at most bufflen-1 characters written, plus a terminating zero
  42. *
  43. * return length of result, or -1 in case of error, with errno set to:
  44. *
  45. *    ERANGE:        buffer is too short
  46. *    ENAMETOOLONG:  the result is too long for a valid path
  47. */
  48. extern int    dirname_r(const char*  path, char*  buffer, size_t  bufflen);
  49. extern int    basename_r(const char*  path, char*  buffer, size_t  bufflen);

  50. __END_DECLS

  51. #endif /* _LIBGEN_H */
复制代码
51_avatar_middle
online_admins 发表于 2016-1-5 22:38:05 | 显示全部楼层
这个库是Gnulib里的,原来的程序应该是Linux/Mac下的吧。
要么你去 http://www.gnu.org/s/gnulib/,看到那个Current Gnulib sources了么。
是 Git维护的源码仓库,需要用个git客户端下载一份源码拿到VC++里去编译成lib。
要么你就去下一个Cygwin,在它里面用g++开发,肯定有Gnulib这个库,只不过这种方式不能生成纯正的Win32程序。
34_avatar_middle
ico_lz  楼主| 发表于 2016-1-8 22:33:30 | 显示全部楼层
Syc 发表于 2016-1-5 22:38
这个库是Gnulib里的,原来的程序应该是Linux/Mac下的吧。
要么你去 http://www.gnu.org/s/gnulib/,看到那 ...

谢谢老大。
您需要登录后才可以回帖 登录 | 加入驿站 qq_login

本版积分规则

关闭

站长提醒上一条 /2 下一条

QQ|小黑屋|手机版|VC驿站 ( 辽ICP备09019393号tongdun|网站地图wx_jqr

GMT+8, 2019-4-20 21:18

Powered by Discuz! X3.4

© 2009-2019 cctry.com

快速回复 返回顶部 返回列表