Fatal error netdb h no such file or directory

AndyD wrote:Try installing the libc6-dev package.

AndyD wrote:Try installing the libc6-dev package.

Thanks for the suggestion, but it already seems to be installed:

Code: Select all

sudo dpkg -s libc6-dev
Package: libc6-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 8204
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Architecture: armhf
Multi-Arch: same
Source: glibc
Version: 2.19-15
Provides: libc-dev
Depends: libc6 (= 2.19-15), libc-dev-bin (= 2.19-15), linux-libc-dev
Suggests: glibc-doc, manpages-dev
Breaks: binutils (<< 2.20.1-1), binutils-gold (<< 2.20.1-11), cmake (<< 2.8.4+dfsg.1-5), gcc-4.4 (<< 4.4.6-4), gcc-4.5 (<< 4.5.3-2), gcc-4.6 (<< 4.6.0-12), libhwloc-dev (<< 1.2-3), libjna-java (<< 3.2.7-4), liblouis-dev (<< 2.3.0-2), liblouisxml-dev (<< 2.4.0-2), make (<< 3.81-8.1), pkg-config (<< 0.26-1)
Conflicts: libc0.1-dev, libc0.3-dev, libc6.1-dev
Description: GNU C Library: Development Libraries and Header Files
 Contains the symlinks, headers, and object files needed to compile
 and link programs which use the standard C library.
Homepage: http://www.gnu.org/software/libc/libc.html

As does libc6 dep:

Code: Select all

sudo dpkg -s libc6
Package: libc6
Status: install ok installed
Priority: required
Section: libs
Installed-Size: 8788
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Architecture: armhf
Multi-Arch: same
Source: glibc
Version: 2.19-15
Provides: glibc-2.19-1
Depends: libgcc1
Suggests: glibc-doc, debconf | debconf-2.0, locales
Breaks: hurd (<< 1:0.5.git20140203-1), libtirpc1 (<< 0.2.3), locales (<< 2.19), locales-all (<< 2.19), nscd (<< 2.19)
Conflicts: prelink (<= 0.0.20090311-1), tzdata (<< 2007k-1), tzdata-etch
Conffiles:
 /etc/ld.so.conf.d/arm-linux-gnueabihf.conf fcce838d54cc444500f01049db2aae8c
Description: GNU C Library: Shared libraries   
 Contains the standard libraries that are used by nearly all programs on
 the system. This package includes shared versions of the standard C library
 and the standard math library, as well as many others.
Homepage: http://www.gnu.org/software/libc/libc.html

My code needs:

and as the error states, /usr/share/netdb.h needs

Looking in the system for netdb.h only reveals:

Code: Select all

sudo find / -iname *netdb.h
/usr/include/netdb.h
/usr/include/arm-linux-gnueabihf/bits/netdb.h

Doing some more googling I found https://github.com/raspberrypi/tools/tr … nclude/rpc

… but I’m not sure what to do with it?

Any help is greatly appreciated.

Thanks


Description


Adam Tkac



2011-05-05 12:34:37 UTC

Description of problem:
Compilation of the bind package fails with "/usr/include/netdb.h:33:24: fatal error: rpc/netdb.h: No such file or directory" error. In my opinion rpc/netdb.h should be present of netdb.h shouldn't include it.

Version-Release number of selected component (if applicable):
glibc-2.13.90-10

How reproducible:
always

Steps to Reproduce:
1. fedpkg clone bind
2. cd bind
3. fedpkg build bind
  
Actual results:
Build fails

Expected results:
Successful compilation

Additional information:
glibc-2.13.90-9 is fine.


Comment 1


Andreas Schwab



2011-05-05 13:34:51 UTC

*** Bug 702366 has been marked as a duplicate of this bug. ***


Comment 2


Brian Millett



2011-05-05 14:03:43 UTC

The glibc-headers-2.13.90-10 changelog includes:

- Update from master
  - Obsolete RPC implementation in libc


I guess not!


Comment 3


Andreas Schwab



2011-05-05 14:04:45 UTC

*** Bug 702368 has been marked as a duplicate of this bug. ***


Comment 4


Tom Lane



2011-05-05 17:46:13 UTC

Same thing observed here:

$ cat test.c
#include <netdb.h>

int main() { return 0; }

$ gcc test.c
In file included from test.c:1:0:
/usr/include/netdb.h:33:24: fatal error: rpc/netdb.h: No such file or directory
compilation terminated.

This breaks my packages as well.


Comment 5


Thomas L. Shinnick



2011-05-05 23:55:17 UTC

Note apparent duplicate 
  https://bugzilla.redhat.com/show_bug.cgi?id=702510

"Me too"  building node.js : 

  deps/c-ares/ares_parse_txt_reply.c:27:0:
/usr/include/netdb.h:33:24: fatal error: rpc/netdb.h: No such file or directory
compilation terminated.

Worked in F14 ...


Comment 7


William Lima



2011-05-06 02:44:50 UTC

*** Bug 702510 has been marked as a duplicate of this bug. ***


Comment 9


John Ellson



2011-05-06 13:17:49 UTC

Thanks. The koji build of glibc-2.13.90-11 fixes the problems I was having building graphviz on fc15 i686 and x86_64 (reported in dup bug #702510)


Comment 11


William Lima



2011-05-06 16:29:39 UTC

For those who tested glibc-2.13.90-11, please give it positive karma (current -6).


Comment 12


Fedora Update System



2011-05-07 15:05:37 UTC

Package glibc-2.13.90-11:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.13.90-11'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.13.90-11
then log in and leave karma (feedback).


Comment 13


Fedora Update System



2011-05-17 05:36:27 UTC

Package glibc-2.13.90-12:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.13.90-12'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.13.90-12
then log in and leave karma (feedback).


Comment 14


Fedora Update System



2011-05-18 18:42:42 UTC

Package glibc-2.13.90-13:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.13.90-13'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.13.90-13
then log in and leave karma (feedback).


Comment 15


Fedora Update System



2011-05-27 20:24:40 UTC

Package glibc-2.13.90-14:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.13.90-14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.13.90-14
then log in and leave karma (feedback).


Comment 16


Fedora Update System



2011-06-02 19:08:41 UTC

Package glibc-2.14-1:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.14-1'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.14-1
then log in and leave karma (feedback).


Comment 17


Fedora Update System



2011-06-04 02:55:34 UTC

Package glibc-2.14-2:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing glibc-2.14-2'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/glibc-2.14-2
then log in and leave karma (feedback).


Comment 18


Fedora Update System



2011-06-07 04:24:55 UTC

glibc-2.14-2 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.


портирование проекта linux -> windows

От: Аноним

 
Дата:  17.02.08 06:28
Оценка:

Потдскажите какие строчки поменятьдобавить?
вот на эту

#include <unistd.h>

вот так ругается

async.hh(25) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
crypt_handler.cpp

тут кое-что поменял

#ifdef WIN32
#include <winsock.h>
//#include <winsock2.h>
//#include <WS2tcpip.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif

#include <stdio.h>
#include <errno.h>
#include <netdb.h>

но вот так ругается на последние 3 строчки…

flow_handler.hh(47) : fatal error C1083: Cannot open include file: 'netdb.h': No such file or directory
stdafx.cpp

тут несоответствие параметров

#define ts_debug(level, fmt, args...) __ts_debug_i(level, __FILE__, __LINE__, fmt, ##args)
#define ts_error(fmt, args...) ts_debug(-1, fmt, ##args)
#define ts_debug_1(fmt, args...) ts_debug(1, fmt, ##args)
#define ts_debug_2(fmt, args...) ts_debug(2, fmt, ##args)
#define ts_debug_3(fmt, args...) ts_debug(3, fmt, ##args)
#define ts_debug_4(fmt, args...) ts_debug(4, fmt, ##args)
#define ts_fatal(fmt, args...) (ts_error(fmt, ##args), exit(-1))

собсно, вот…

 error C2010: '.' : unexpected in macro formal parameter list

_________
Заранее благодарен!

19.02.08 13:31: Перенесено модератором из ‘C/C++’ — Кодт


Re: портирование проекта linux -> windows

От:

ioni

Россия

 
Дата:  17.02.08 08:18
Оценка:

Здравствуйте, Аноним, Вы писали:

#include <unistd.h>

такого файла в windows нет
а что там такое?

>тут кое-что поменял

#ifdef WIN32

#include <windows.h>
#include <winsock2.h>

#else
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h> 
#endif

#include <stdio.h>
#include <errno.h>
// #include <netdb.h> // <-- такого файла нет
А>
#define ts_debug(level, fmt, args...) __ts_debug_i(level, __FILE__, __LINE__, fmt, ##args)
#define ts_error(fmt, args...) ts_debug(-1, fmt, ##args)
#define ts_debug_1(fmt, args...) ts_debug(1, fmt, ##args)
#define ts_debug_2(fmt, args...) ts_debug(2, fmt, ##args)
#define ts_debug_3(fmt, args...) ts_debug(3, fmt, ##args)
#define ts_debug_4(fmt, args...) ts_debug(4, fmt, ##args)
#define ts_fatal(fmt, args...) (ts_error(fmt, ##args), exit(-1))

с этим надо разбираться отдельно но по всей видимости это обычные трейсы
для начала заменить на обычный printf или OutputDebugString


Re: портирование проекта linux -> windows

От:

Michael7

Россия

 
Дата:  17.02.08 12:03
Оценка:

Здравствуйте, Аноним, Вы писали:

А>Потдскажите какие строчки поменятьдобавить?

Если программа использует не только стандартные функции и библиотеки C/C++ так просто «на халяву» вы из linux в windows код не перенесёте. Нужно разбираться с работой. Я смотрю, там у вас есть в частности сокеты, а они в linux и windows не совсем одинаково работают, что описано хотя бы в этой статье:

Разница в работе с сокетами Windows и Linux

Автор: Gomes
Дата: 06.10.05


А>вот на эту

А>

А>#include <unistd.h>
А>


А>вот так ругается

Потому что это в Posix системах такая вещь: unistd.h

Дальше и смотреть особо не стал. Если программа активно работает с системой, а не только через стандартные функции C/C++ вам надо понимать, что она делает в linux и как можно перенести в windows. Механический подход, скорее всего, не прокатит. Некоторые posix-вещи не имеют прямых аналогов в windows, самая известная — fork() и требуют переписывания.

Могу ещё сказать, что если вы пытаетесь перенести какую-то более-менее известную OpenSource-программу, есть смысл поискать получше, скорее всего уже кто-то её портировал


Re: портирование проекта linux -> windows

От: Аноним

 
Дата:  17.02.08 21:42
Оценка:

Здравствуйте, Аноним, Вы писали:

А>Потдскажите какие строчки поменятьдобавить?

А>вот на эту

Если надо быстро пользуй cygwin.

А так, все инклюды которых нет просто коментируй примерно так
#ifndef __WIN32__
#include <unistd.h>
..
#endif

макросы с произвольным кол-вом параметров:
или пользуй minGW
или пиши заглушки типа

>#define ts_debug(level, fmt, args…) __ts_debug_i(level, __FILE__, __LINE__, fmt, ##args)

void __ts_debug_i_v(int level,const char* file,int line,const char* fmt,va_list v);
struct ts_debug_helper {
    const char* file; int line;
    ts_debug_helper(const char* file,int line) : file(file), line(line) {}
    void operator() (int level,const char* fmt,...) {
        va_list v;va_start(v,fmt);
        __ts_debug_i_v(level,file,line,fmt,v);
        va_end(v);
    }
};
#define ts_debug ts_debug_helper(__FILE__,__LINE__)


Re[2]: портирование проекта linux -> windows

От: Аноним

 
Дата:  18.02.08 11:36
Оценка:

На что можно заменить?
#include <sys/uio.h>
#include <sys/ioctl.h>
#include <dlfcn.h>


Re: портирование проекта linux -> windows

От:

superlexx

 
Дата:  18.02.08 12:35
Оценка:

1 (1)

ecли проект не ширпотребный, то можешь попробовать interix (Subsystem For UNIX Applications), там POSIX с forkом и все твои headerы есть.


Re[3]: портирование проекта linux -> windows

От:

Michael7

Россия

 
Дата:  18.02.08 12:58
Оценка:

Здравствуйте, Аноним, Вы писали:

А>На что можно заменить?

А>#include <sys/uio.h>
А>#include <sys/ioctl.h>

Эти модули поддерживают разные операции ввода-вывода. Надо смотреть, что конкретно используется.

А>#include <dlfcn.h>

Необходим для работы с разделяемыми динамически-загружаемыми библиотеками.

Скорее всего, вам достаточно уже подключенных windows.h и winsock2.h. Как вам уже посоветовали, комментируете отсутствующие в Win32-среде *.h , а далее смотрите на какие отсутствующие декларации функций ругается компилятор. Лезете в документацию по Linux/Posix, читаете что они делают и пытаетесь припомнить аналог в Win32.

У меня такое впечатление, что вы хотите как-то по-быстрому запихать linux-программу в Windows. Весьма вероятно, ничего хорошего не выйдет, программирование для linux и для windows имеют достаточно много отличий, чтобы потребовалось переписать около 20%-30% слоя кода, тесно завязанного на систему.

Могу присоединиться к совету использовать Cygwin или MinGW, если вам требуется быстро скомпилировать и заставить работать в Windows линуксовый код.

Cygwin — добавляет в Windows библиотеки и окружение, реализующие posix-вызовы, создавая Unix внутри Windows. Часто самый простой способ заставить работать linux-программу в Windows, часто достаточно её просто скомпилировать в Cygwin. Но для работы, очень возможно, будет необходим установленный Cygwin, хотя может оказаться достаточно некоторых dll от него.

MinGW + MSys — порт компилятора gcc и shell-окружения в Windows. В отличие от Cygwin, откомпилированные в MinGW + MSys программы работают с windows-окружением и не требуют MSys для своей работы. Возможно, потребуется некоторая доработка.


Re[2]: портирование проекта linux -> windows

От: Аноним

 
Дата:  18.02.08 14:28
Оценка:

Здравствуйте, superlexx, Вы писали:
S>ecли проект не ширпотребный, то можешь попробовать interix (Subsystem For UNIX Applications), там POSIX с forkом и все твои headerы есть.
Нашел там только #include <sys/ioctl.h> , в рочем лучше чем ничего, а #include <dlfcn.h> выдернул из другово проекта, вроде на нем не ломается.

Категорически против вЕндолинуксяторов, а вот mingw попробую, но хочутся получить просто «прогу» под винду)

> или пиши заглушки типа

>#define ts_debug(level, fmt, args…) __ts_debug_i(level, __FILE__, __LINE__, fmt, ##args)
Хм, а можно подробнее, как это работает? Или как в гугле спросить непорусски?)


Re[3]: портирование проекта linux -> windows

От:

superlexx

 
Дата:  18.02.08 19:31
Оценка:

Здравствуйте, Аноним, Вы писали:

А>Нашел там только #include <sys/ioctl.h>

там остальные тоже есть, см. /usr/include и ищите по именам файлов в %WINDIR%SUA.


Re[3]: портирование проекта linux -> windows

От: Аноним

 
Дата:  18.02.08 21:33
Оценка:

Здравствуйте, Аноним, Вы писали:

>> или пиши заглушки типа

>>#define ts_debug(level, fmt, args…) __ts_debug_i(level, __FILE__, __LINE__, fmt, ##args)
А>Хм, а можно подробнее, как это работает? Или как в гугле спросить непорусски?)
Очень просто работает.
http://www.gnu.org/software/libtool/manual/libc/Variable-Arguments-Output.html
http://gcc.gnu.org/onlinedocs/gcc-4.2.2//cpp/Variadic-Macros.html#Variadic-Macros

А в VS надо писать что-то типа такого:

#include <stdio.h>
#include <stdarg.h>

void ts_debug_v(const char* file,int line,const char* func,const char* fmt,va_list v) {
    printf("DEBUG: ");vprintf(fmt,v);
    printf("n file: %sn"
             " line: %dn"
             " func: %sn", file,line,func);
}

struct ts_debug_t {
    const char *file, *func; int line;
    ts_debug_t(const char* file,int line,const char* func) : file(file),line(line),func(func){}
    void operator() (const char* fmt,...) {
        va_list v;va_start(v,fmt);
        ts_debug_v(file,line,func,fmt,v);
        va_end(v);
    }
};
#define ts_debug ts_debug_t(__FILE__,__LINE__,__FUNCTION__)

void aaa() {
    ts_debug("point1 %d-%d",1,23);
}

void bbb() {
    ts_debug("point2 %s","text");
}

int main(int argc, const char *argv[]) {
    aaa();
    bbb();
    return 0;
}

/*
DEBUG: point1 1-23
 file: c:homeАнонимtempts_debug.cpp
 line: 23
 func: aaa
DEBUG: point2 text
 file: c:homeАнонимtempts_debug.cpp
 line: 27
 func: bbb 
*/

Надеюсь всё прозрачно

Подождите ...

Wait...

  • Переместить
  • Удалить
  • Выделить ветку

Пока на собственное сообщение не было ответов, его можно удалить.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Fatal error microsoft basic render driver detected as primary device crossout
  • Fatal error maxretry is not a valid variable name for this driver
  • Fatal error maximum function nesting level of 100 reached aborting in
  • Fatal error math h no such file or directory
  • Fatal error mapping iso please check if file is present and defragmented

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии