Author Topic: fdopen: Bad file descriptor  (Read 20453 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
fdopen: Bad file descriptor
« on: August 14, 2007, 03:43:10 pm »
Does anyone else get this on linux :

Quote
if g++ -DHAVE_CONFIG_H -I. -I. -I../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../src/include/wxscintilla/include -I../../src/include -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/wxFlatNotebook/include -I../../src/src/wxAUI -DENABLE_BINRELOC -DAPP_PREFIX="\"/usr/local\"" -Ulinux -Uunix  -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT app.o -MD -MP -MF ".deps/app.Tpo" -c -o app.o app.cpp; \
        then mv -f ".deps/app.Tpo" ".deps/app.Po"; else rm -f ".deps/app.Tpo"; exit 1; fi
In file included from ../../src/include/logmanager.h:5,
                 from app.cpp:55:
../../src/include/logger.h:4:25: error: calling fdopen: Bad file descriptor
make[3]: *** [app.o] Error 1

Offline killua

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: fdopen: Bad file descriptor
« Reply #1 on: August 14, 2007, 03:47:53 pm »
Yeah, I got it just a bit ago, but I decided to do a make clean, and then a re-make.  I'll see if I still get it after it gets to that point...

[EDIT] Update: Still get the error after doing a make clean...will await a fix to be submitted before I proceed.
« Last Edit: August 14, 2007, 03:58:51 pm by killua »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: fdopen: Bad file descriptor
« Reply #2 on: August 14, 2007, 06:45:57 pm »
Does anyone else get this on linux :

Quote
if g++ -DHAVE_CONFIG_H -I. -I. -I../../src/include -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../src/include/wxscintilla/include -I../../src/include -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/wxFlatNotebook/include -I../../src/src/wxAUI -DENABLE_BINRELOC -DAPP_PREFIX="\"/usr/local\"" -Ulinux -Uunix  -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT app.o -MD -MP -MF ".deps/app.Tpo" -c -o app.o app.cpp; \
        then mv -f ".deps/app.Tpo" ".deps/app.Po"; else rm -f ".deps/app.Tpo"; exit 1; fi
In file included from ../../src/include/logmanager.h:5,
                 from app.cpp:55:
../../src/include/logger.h:4:25: error: calling fdopen: Bad file descriptor
make[3]: *** [app.o] Error 1

Haven't tried but whenever you see the "calling fdopen: Bad file descriptor" error, it's because a precompiled header is #included in a header file (should only be #included in source files (*.cpp)).
Be patient!
This bug will be fixed soon...

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: fdopen: Bad file descriptor
« Reply #3 on: August 14, 2007, 06:54:45 pm »
Haven't tried but whenever you see the "calling fdopen: Bad file descriptor" error, it's because a precompiled header is #included in a header file (should only be #included in source files (*.cpp)).

Thanks Yiannis for the invaluable hints. It works now. :D
Be a part of the solution, not a part of the problem.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: fdopen: Bad file descriptor
« Reply #4 on: August 14, 2007, 06:55:47 pm »
Removed the include.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: fdopen: Bad file descriptor
« Reply #5 on: August 14, 2007, 11:20:06 pm »
damn, that I didn't see that, me the pch killer  :?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: fdopen: Bad file descriptor
« Reply #6 on: August 14, 2007, 11:44:06 pm »
Removed the include.
Doesn't work for me on Windows after trying to do a clean re-compilation. Fails with "fdopen" of sdk.h in InfoPane.h. :-(
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: fdopen: Bad file descriptor
« Reply #7 on: August 14, 2007, 11:54:11 pm »
same thing sdk.h should not be included in a header, i am fixing this. And this time linux didn't complain ....

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: fdopen: Bad file descriptor
« Reply #8 on: August 14, 2007, 11:58:04 pm »
committed : try again