User forums > General (but related to Code::Blocks)
g++: no input files Process terminated with status 1 (0 minutes, 0 seconds)
MRufus:
I am working on latest distro of Ubuntu on Codeblocks and trying to compile this code
/*
* Acquisition over network cameras. Seem to work only with ffmpeg
*
* For macosx users, install ffmpeg (e.g. from fink) and recompile opencv this way
* http://stackoverflow.com/questions/583969/compile-opencv-on-mac-with-ffmpeg-instead-of-quicktime
*
*/
#include "cv.h"
#include "highgui.h"
#include <iostream>
#define MISSING_FRAMES_TIMEOUT 10
using namespace std;
// Uncomment if you have OpenCV + FFMPEG
#define HAVE_FFMPEG
#ifdef HAVE_FFMPEG
extern CvCapture* cvCreateFileCapture_FFMPEG( const char* filename );
#endif
/**
* Main entry point of Motion. Launches all the motion threads and contains
* the logic for starting up, restarting and cleaning up everything.
*/
int main (int argc, char **argv) {
#ifdef HAVE_FFMPEG
/* If i is 0 it means no thread files and we then set the thread number to 1 */
string host("http://at@15.12.156.145/mjpg/video.mjpg");
CvCapture *capture = cvCreateFileCapture_FFMPEG(host.c_str());
string winBlobsName("Camera over network");
cvNamedWindow(winBlobsName.c_str());
while (capture) {
// Grab frame
int grab=cvGrabFrame(capture );
if (grab<0) {
cerr << "Error in capturing frame\n" << endl;
break;
}
// Retrieve frame
IplImage *img = cvRetrieveFrame(capture);
cvShowImage(winBlobsName.c_str(),img);
cvWaitKey(2);
}
#endif
return 0;
}
It requires Opencv and ffmpeg which I installed earlier. But when Im trying to compile the code it tells me
Compiling: main.cpp
g++: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
If I try to run it it will say that it seems like this project has not been built yet. Would you like to build it? I say yes, it asks me the same question once more I say yes again and then nothing.
If I put in some simple code like hello world it works fine. Did anyone encounter this kind of problem before?
Jenna:
Please turn on full commandline logging and post the build log here:
change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline"
And please tell us which version of Code::Blocks you use.
MRufus:
here is a full build log
g++ -Wall -fexceptions -g 'pkg-config opencv --cflags' 'sdl-config --cflags' -c /home/rufat/Desktop/hello/TesttheFFMPEG/main.cpp -o obj/Debug/main.o
g++: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
The version of Code blocks I'm using is 8.02
MRufus:
Additional info:
In order for it to recognize Opencv I had to go to Project build options -> Compiler Settings-> Other options and added
'pkg-config opencv --cflags'
'sdl-config --cflags'
Also in Linker setting -> Other linker options I added
'pkg-config opencv --libs'
'sdl-config --libs'
Jenna:
--- Quote from: MRufus on June 04, 2010, 06:11:20 pm ---Additional info:
In order for it to recognize Opencv I had to go to Project build options -> Compiler Settings-> Other options and added
'pkg-config opencv --cflags'
'sdl-config --cflags'
Also in Linker setting -> Other linker options I added
'pkg-config opencv --libs'
'sdl-config --libs'
--- End quote ---
It looks like you use an apostrope to surround the pkg-config stuff. You need a backtick ( "`" , french grave accent) here.
Navigation
[0] Message Index
[#] Next page
Go to full version