在coldblock中编写新俄罗斯方块块游戏中出现 fatal error: bios.h: No such file or directory

c - fatal error: libavcodec/avcodec.h no such file or directory compilation terminated - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
I'm trying to execute tutorial01.c using gcc and I have the gcc and tutorial01.c in the same folder along with libavcodec and libavformat and its associated files it gives me this error
fatal error: libavcodec/avcodec.h no such file or directory compilation terminated
when I run
gcc -o tutorial01 tutorial01.c -lavformat -lavcodec -lz through the terminal in ubuntu 12.04
the code is
libavcodec/avcodec.h
#include libavformat/avformat.h
#include stdio.h
void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame)
char szFilename[32];
// Open file
sprintf(szFilename, "frame%d.ppm", iFrame);
pFile=fopen(szFilename, "wb");
if(pFile==NULL)
// Write header
fprintf(pFile, "P6\n%d %d\n255\n", width, height);
// Write pixel data
for(y=0; y& y++)
fwrite(pFrame-&data[0]+y*pFrame-&linesize[0], 1, width*3, pFile);
// Close file
fclose(pFile);
int main(int argc, char *argv[])
AVFormatContext *pFormatC
AVCodecContext
*pFrameRGB;
if(argc & 2)
printf("Please provide a movie file\n");
return -1;
// Register all formats and codecs
av_register_all();
// Open video file
if(av_open_input_file(&pFormatCtx, argv[1], NULL, 0, NULL)!=0)
return -1; // Couldn't open file
// Retrieve stream information
if(av_find_stream_info(pFormatCtx)&0)
return -1; // Couldn't find stream information
// Dump information about file onto standard error
dump_format(pFormatCtx, 0, argv[1], 0);
// Find the first video stream
videoStream=-1;
for(i=0; i&pFormatCtx-&nb_ i++)
if(pFormatCtx-&streams[i]-&codec-&codec_type==CODEC_TYPE_VIDEO)
videoStream=i;
if(videoStream==-1)
return -1; // Didn't find a video stream
// Get a pointer to the codec context for the video stream
pCodecCtx=pFormatCtx-&streams[videoStream]-&
// Find the decoder for the video stream
pCodec=avcodec_find_decoder(pCodecCtx-&codec_id);
if(pCodec==NULL)
fprintf(stderr, "Unsupported codec!\n");
return -1; // Codec not found
// Open codec
if(avcodec_open(pCodecCtx, pCodec)&0)
return -1; // Could not open codec
// Allocate video frame
pFrame=avcodec_alloc_frame();
// Allocate an AVFrame structure
pFrameRGB=avcodec_alloc_frame();
if(pFrameRGB==NULL)
return -1;
// Determine required buffer size and allocate buffer
numBytes=avpicture_get_size(PIX_FMT_RGB24, pCodecCtx-&width,
pCodecCtx-&height);
buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
// Assign appropriate parts of buffer to image planes in pFrameRGB
// Note that pFrameRGB is an AVFrame, but AVFrame is a superset
// of AVPicture
avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,
pCodecCtx-&width, pCodecCtx-&height);
// Read frames and save first five frames to disk
while(av_read_frame(pFormatCtx, &packet)&=0)
// Is this a packet from the video stream?
if(packet.stream_index==videoStream)
// Decode video frame
avcodec_decode_video(pCodecCtx, pFrame, &frameFinished,
packet.data, packet.size);
// Did we get a video frame?
if(frameFinished)
// Convert the image from its native format to RGB
img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24,
(AVPicture*)pFrame, pCodecCtx-&pix_fmt, pCodecCtx-&width,
pCodecCtx-&height);
// Save the frame to disk
if(++i&=5)
SaveFrame(pFrameRGB, pCodecCtx-&width, pCodecCtx-&height,
// Free the packet that was allocated by av_read_frame
av_free_packet(&packet);
// Free the RGB image
av_free(buffer);
av_free(pFrameRGB);
// Free the YUV frame
av_free(pFrame);
// Close the codec
avcodec_close(pCodecCtx);
// Close the video file
av_close_input_file(pFormatCtx);
8,11021631
You need to add the path to the libavcodec and libavformat include files to your command line. Find the include/ directory and add
-Ipath/to/include
for each of the relevant include files.
You'll also need to do the same thing for the library directories, using -L.
93k15111205
That error occur due to error in path
-L/home/yourpath/ffmpeg_build/lib/
-I/home/yourpath/ffmpeg_build/include/
ffmpeg_build – Where the files will be built and libraries installed.
create file "execute.sh "
NOW open file and paste the following code :
g++ -Wno-format-zero-length -Wno-write-strings -L/home/yourpath/ffmpeg_build/lib/ -I/home/yourpath/ffmpeg_build/include/ -o output program.cpp -lavcodec -lavformat -lavutil -lavdevice -lswresample -lswscale -lm -lva -lpthread -lvorbis -lvpx -lopus -lz -lpostproc -ldl -lfdk-aac -lmp3lame -lvorbisenc -lvorbisfile -lx264 -ltheora -ltheoraenc -ltheoradec -ldl -lrt -lx265 -lbz2
sh execute.sh and binary will be created in the name "output"
then type ./output for output.
Note : above for C++ , for c code change g++ to gcc
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabledUbuntu :: Fatal Error: Iostream.h: No Such File Or Directory Compilation Terminated While Compiling C++ Code
Dec 9, 2010
whenever i am trying to compile a c++ program i am getting the following error sample.cpp:1: fatal error: iostream.h: No such file or directory compilation terminated
Similar Messages:
ADVERTISEMENT
Feb 22, 2011
i try to compile my SD_APP.cc but i encountered a error, how do i resolve this?In file included from SD_APP.cc:1: SD_APP_HDR.h:6: fatal error: agent.h: No such file or directory compilation terminated.
Jun 8, 2010
I create a simple code for add two number:Code:#include&iostream.h&#include&stdio.h&main(){int num1, num2,code....I search the answer to my problem in various forums but I can't solve the problem.I think that is due to I need some package or that I don't install the necessary libraries.
Apr 8, 2011
I recently switched to ubuntu, so kinda new to it. I installed g++ byCode:sudo apt-get install build-essentialand now when i'm trying to compile this:[code]....
Oct 29, 2010
I am trying to install a program called airfart and when I run make after cd'ing to the appropriate file i get thisCode:g++ -g `pkg-config gtk+-2.0 --cflags` -o src/main.o -c src/main.cppPackage gtk+-2.0 was not found in the pkg-config search path.Perhaps you should add the directory containing `gtk+-2.0.pc'[code]....
May 31, 2011
I'm using Slackware 13.37 x64 (upgraded to slackware-current) and I have trouble compiling mysql workbench 5.2.34. The error is:Code:scintilla-marshal.c:2:25: fatal error: glib-object.h: No such file or directoryBut I have that glib-object.h file:Code:$ locate glib-object.h/usr/include/glib-2.0/glib-object.hThis is when I try to compile version 5.2.27:Code:./PlatGTK.cxx:13:21: fatal error: gdk/gdk.h: No such file or directoryCode:$ locate gdk.h/usr/include/gtk-1.2/gdk/gdk.h/usr/include/gtk-2.0/gdk/gdk.h
Feb 19, 2011
I am trying to upgrade my NAS with anew toolchain, gcc-4.5.2. The NAS have been &hacked& fonz_plug, that contain a gcc version 4.1.3 with uClibc. I have download all needed tar files and done the following.My goal is to upgrade the gcc to 4.5.2 and replace the ucLibc on the system with a GNU libc.# Pass one ## binutils./configure --prefix=/ffp --libdir=/ffp/lib --includedir=/ffp/include --with-gmp=/ffp --with-mpfr=/ffpBut when I try to compile the gcc with ../configure --prefix=/ffp --libdir=/ffp/lib --includedir=/ffp/include --enable-__cxa_atexit --with-float=soft --enable-languages=c,c++ --with-build-sysroot=/ffp --with-build-time-tools=/ffp/bin --with-system-zlib --enable-threads=posix --disable-bootstrap[Code]...
Oct 13, 2010
since the recent upgrade to Maverik every time I boot this error message appear on the top of the screen: &modprobe: Fatal: Could not load /lib/modules/2.6.35-22-generic/modules.dep: no such file or directory& fter that plymouth starts without any graphics and the first visible object is the login interface (GDM)
Jun 12, 2011
I'm trying to build a program called Obpager, but I'm getting an error saying I don't have xlib.h. From what I understand, that file is included in libx11-dev, which I have installed. Any idea?Code:dagoss@MAGIC-PORT:~/Downloads/obpager-1.8$ makeCompiling src/main.ccIn file included from src/main.cc:33:0:[code]....
Oct 2, 2010
I have updated to ubuntu 10.10, but when I try to compile chromium on ubuntu, I get this error:Code:In file included from /usr/include/gtk-2.0/gdk/gdkcairo.h:28,from /usr/include/gtk-2.0/gdk/gdk.h:33,from app/active_window_watcher_x.cc:6:/usr/include/gtk-2.0/gdk/gdkpixbuf.h:37: fatal error: gdk-pixbuf/gdk-pixbuf.h: No such file or directoryWhat I don't understand is why gtk-2.0/gdk/gdkpixbuf.h complains that gdkpixbuf/gdk-pixbuf.h is not found. And how can I fix it?
Mar 11, 2010
Here is what i do: make clean make makefiles CCARGS='-DEF_CONFIG_DIR=&/opt/product/postfix-2.6.5/etc&-DEF_COMMAND_DIR=&/opt/product/postfix-2.6.5&-DEF_DAEMON_DIR=&/opt/product/postfix-2.6.5/libexec&-DEF_MAILQ_PATH=&/opt/product/postfix-2.6.5/bin/mailq&-DEF_DATA_DIR=&/opt/product/postfix-2.6.5/lib&-DEF_NEWALIAS_DIR=&/opt/product/postfix-2.6.5/bin/newaliases&[Code]...make install then i got this error: postfix: fatal: chdir(/usr/libexec/postfix): No such file or directory make: *** [install] Error 1 I don't understand why it's checking the usr/libexec folder for the daemons although I've set the folder to /opt/product/postfix-2.6.5/libexec in the makefile. Here is also the cat of my makedefs.out:[Code]....
Apr 14, 2011
Tonight I installed ubuntu 10.10 (32 bit) on an external usb harddrive with a dvd I burned and I used my older desktop. I disconnected all internal and external drives first so everything had to be put on the usb drive I selected (only option available). I used the option to load extra software, use the entire hard drive, and let the software do it's thing. I basically had no options where to put things and it didn't have much choice.
When I boot the usb drive on my laptop (win 7 64 bit) by telling the bios to boot to it first... I get an error: modprobe: FATAL Could not load /lib/modules 2.6.35-22 generic modules No such file or directory. This message appears twice and then it does boot into ubuntu and seems to work fine.
I'm new to this OS so that is an uneducated guess but the things I have done seem to be
working. So exactly what is this error referring too? Is there a way to fix the problem or do I just ignore it.
Jul 3, 2010
Is there an online resource to lookup error messages generated when compiling C++ code?
Mar 4, 2011
Im sure that this issue is pretty old and you get some results from forums when you google it, but I cant seem to find the solution : When I boot my system ( its duel boot , win7 / Slackware 13.1 ) the message : L 99 99 99 pops up. I know this has to do with the MBR, When I looked online this is what people were told to do: [Code]///
Jun 2, 2010
My USB stick is this one: [URL] I can't get it to scan my frequencies. PC finds the stick (lsusb):Code:Bus 002 Device 005: ID 15a4:9016 Afatech Technologies, Inc. AF9015 DVB-T USB2.0 stick When I plug it in, dmesg shows this:Code:[ ] usb 2-2: new high speed USB device using ehci_hcd and address 7[ ] usb 2-2: configuration #1 chosen from 1 choice[ ] af9015: tuner id:179 not supported, please report![ ] Afatech DVB-T 2: Fixing fullspeed to highspeed interval: 10 -& 7[code]....But if the directory is created, then after the same command I haveCode:scanning /usr/share/dvb/dvb-t/lv-Rigausing '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'main:2273: FATAL: failed to open '/dev/dvb/adapter0/frontend0': 19 No such deviceI found on the internet a firmware for my USB HDTV DVB-T stick named &dvb-usb-af9015.fw& and copied it into /lib/firmware/ but I have not seen any difference with that.
Feb 11, 2010
i have ubuntu karmic 9.10 and when i try to update anything or install anything the a very similar error occurs.&(Reading database . . . 55%dpkg: unrecoverable fatal error , aborting: files list file for package `com.palm.net.precoddr.fcoaster' contains empty filenameit repeats this message 3 times then gives up i believe.
May 25, 2010
I wrote a program in c++ on fedora 11. When i compiled it using g++. it displays the following error: g++ fibnocci.cppfibnocci.cpp:2:22: error: iostream.h: No such file or directoryfibnocci.cpp: In function int main():fibnocci.cpp:8: error: cout was not declared in this scopefibnocci.cpp:8: error: endl was not declared in this scope
Jun 5, 2011
Just switched over to Ubuntu 11.04 32bit. I have spent the day configuring it to my likings, and am content with Ubuntu. I have zero experience with coding, and bare minimum knowledge. Anyways, I have gotten some tar.gz files, that I have extracted them into folders, and then in terminal I run ./configure, and then I get the error &You need intltool 0.40.0 or later&.
May 22, 2010
I'm using Vector Linux for years without any issues, But I'm really paining with configure X for perfect performance for my newly bought(only 1 month old) PC (which has the intel 845G graphic chip)I also tried compiling the official driver from the Intel site but the compilation fails.After that I used i810 driver in xorg.conf, Its not stable and not reliable. Finally(even now) I'm using vesa driver,Its stable but I cannot play
videos.video grabs always.
Dec 13, 2009
how vlc source code can be compiled?
Aug 9, 2011
After messing up with grub, I reformatted my hdd and installed opensuse 11.4 (gnome+kde) from the dvd and also included the java sdk while installing, now the problem is that whenever i compile a java program, I get this error Code: /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
Aug 28, 2009
I had been working on a CPP code for sometime now, without being aware that some parts of its code, especially security related were not being compiled. Problem was like my product did not work for SSL mode. On analysis, I found that some part of CPP codes inside a switch(ENABLE_SSL_LIBRARY)were not getting compiled at all. And also that this gets set when we do newgrp crypto command on the box. This left me without lots of doubts. I wanted to understand how these switches work and if this switch was propreitary to my code or something related to Linux. My questions now are: 1. Switches like the one mentioned above, are they user defined, for my particular code or are they related to Linux/GCC or makefiles?2.If a user can define such switches to control code compilation, then need to know the concepts/procedures behind it. How is it done ?Kindly excuse if these are very very basic. But since I could not get proper stuffs on google, I thought I should ask some experts here who could either explain me or point me to appropriate resources (links of articles / tutorials)
Jan 19, 2010
Just i need some clarification. Is there any different form compilation is for Intel ATOM processor? Its same like all other intel processors right? or it has any different type of compilation should be followed for Intel atom processor?
Jan 19, 2010
Just I need some clarification. Is there any different form compilation is for Intel ATOM processor? Its same like all other intel processors right? Or it has any different type of compilation should be followed for Intel atom processor?
Sep 6, 2009
This morning when attempting to upgrade ( followed by aptitude safe-upgrade) my system I started receiving the following error:Preconfiguring packages ...(Reading database ... dpkg: unrecoverable fatal error, aborting:unable to open files list file for package `apache2-doc': Stale NFS file handleE: Sub-process /usr/bin/dpkg returned an error code (2)A package failed to install. Trying to recover:It doesn't seem to matter what repository I use or what particular package that I attempt to upgrade (all or just a single package). (In particular, apache2-doc is not even a package being upgraded, although it is installed on the system.) I have rebooted, run apt-get clean, run apt-get check, etc. to no avail. I am running a standard Debian (5.0.2/Lenny) desktop PC and am not running any NFS processes, client or server.
Feb 10, 2010
I want to compile the the source code given in a well known unix programming book(stevens) .I downloaded the codes but unable to build it ,giving me an errorerror: stropts.h: No such file or directoryI don't know what to do....I am using fedora 11 latest gcc in the system.I also try to include the search path which include a file -I./usr/include/xulrunner-sdk-1.9.1/system_wrappers but itI open the header file and the definition is there #include_next&strops.h&so ultimately there is not the original file
Jan 16, 2011
Recently I have downloaded TBB and I want to run a program using its libraries. But I encountered the following error: Linker: fatal error LNK1104: cannot open file 'tbb_debug.lib'
Oct 18, 2007
I'm running openSuse 10.2 and a couple of days ago I installed a kernel patch via yast/autoupdate.
I finally rebooted today and found out the gui, mouse and network are not working.
External USB drive is working but really slow.
I've got the gui working by running sax2 -r -m 0=vesa but no luck with the mouse & network. Below is a extract of boot.msg The lib/modules2.6.18... directory it refers to is mostly empty.
I'm kind of new at this so I don't know if more info is needed.
Retry device configurationdone&notice&'boot.udev_retry start' exits with status 0&notice&boot.videobios start[code]....
Mar 6, 2011
I want set up VPN on my VPS but when i try to turn on tun/tap i see::/lib/modules# modprobe tunFATAL: Could not load /lib/modules/2.6.18-194.17.1.el5.028stab070.7PAE/modules.dep: No such file or directoryos : debian 5(folder lib/modules is empty)
Apr 9, 2010
Awhile back, PabloTwo pointed me to zenity as a way to create bash scripts with changeable parameters.
That thread is here, for anyone interested in reading about it: [URL] Anyway, my problem is that I'm trying to capture input that contains double-dashes (&--&) but zenity (or maybe or it's bash???) complains with the following error message: &This option is not available. for all possible usages.bash: [/code]: No such file or directory&Here's an example of what I'm doing:Code:# Select the time of dayFlytime=`zenity --list --text=&Select the Time& --radiolist --height=300 --width=300 --hide-column=2 --column=&Select& --column=&Code& --column=&Time of Day& && &--timeofday=real& &Local Time& [code]....What I want to accomplish is for the variable $Flytime to contain either &--timeofday=real& or &--timeofday=dawn& (without the quotes) depending upon which radio button is selected.
I have tried escaping &--timeofday& (e.g. &--timeofday& and even &--timeofday&)
but that's not working.
Copyrights 2005-15 , All rights reservedfatal error: IOStream: No such file or d - C++ Forum
fatal error: IOStream: No such file or d
& fatal error: IOStream: No such file or directory
Jun 13, 2011 at 8:17pm UTC
I know this is a topic well discussed, but I have looked through this and other forums, but others mistakenly use .h.
I am running Ubuntu with G++ 4.5.2.
#include &iostream&
int main()
cout && "Hello world." &&
return -1;
I compile with:
G++ HelloWorld.cpp
My error is:
HelloWorld.cpp:1:20: fatal error: IOStream: No such file or directory
compilation terminated.
I can compile fine with both geany and eclipse IDE, but I am practicing with programming with terminal.
Since it compiles with the IDE, I am leaning toward g++ and libraries being installed correctly.
I have the iostream file in /usr/include/c++/4.5/iostream directory.
I would appreciate any help because I have struggling with this for a couple of days now.
Jun 13, 2011 at 8:32pm UTC
Hi scratch509 I gust go throughout the code and I want to explain something:
In the main function when u return it u return 0 which is an interger that means return nothing.
If u return -1 in any function that means that u are logically that thear is an error.
I hope that u understand .
Jun 13, 2011 at 8:37pm UTC
To build it type:&
make HelloWorld
Jun 13, 2011 at 8:43pm UTC
closed account ()
ARWA wrote:In the main function when u return it u return 0 which is an interger that means return nothing.
You couldn't be anymore wrong. void means you return nothing. When he/she returns -1, he/she returns -1, not 0.
ARWA wrote:If u return -1 in any function that means that u are logically that thear is an error.
What if I had a method that returned -1 on a successful call? It may not be common to return -1 on a successful method call, but neve everybody's coding style is different.
Scratch, a glance at your code reveals no apparent errors. However, considering you're on Ubuntu, installation is different than Windows. It would be beneficial to post this question in the Unix/Linux section of this forum.
Last edited on Jun 13, 2011 at 8:44pm UTC
Jun 13, 2011 at 8:45pm UTC
You might have a problem with case sensitivity.
The header is called iostream, not IOStream. Likewise, the compiler is called g++, not G++.
Jun 13, 2011 at 9:04pm UTC
Thanks everyone for the replies.
I figured out my issue here.
I don't even want to admit it, but it does help if you compile the same file you are editing.
I did take the uppercase and the -1 comment onboard though and will remember it.
I have a nearly similar issue on my MacOSX computer, but there it doesn't even compile with an IDE.
That is my next thing to figure out.
You guys are awesome.
Topic archived. No new replies allowed.

我要回帖

更多关于 俄罗斯方块小游戏 的文章

 

随机推荐