$result=exec("test.exe $query");
上面这个是php代码,想要执行test.exe,query是传入的参数。其中test.exe中用到了OpenCV的函数,其源代码如下:
#include <stdio.h>
#include <cv.h>
#include <highgui.h>int main(int argc, char* argv[])
{
   FILE *fp = fopen("abc.txt","w");
   IplImage* src = cvLoadImage("f:\\snail.jpg", 1);   fprintf(fp,"abc\n");
   printf("result ***********\n");   cvNamedWindow("img", CV_WINDOW_AUTOSIZE);
   cvShowImage("img", src);
   cvWaitKey(0);   if (argc > 1)
      printf("%s\n", argv[1]);   return 0;
}
不要管这个代码是干嘛的(其实是随便乱写的一个代码),反正就是执行不了,如果去掉和OpenCV的有关代码,然后就没问题了,请问是不是需要进行一些设置或者什么的呢?exe是在VC6下生成的,在cmd中运行没有问题,操作系统是Windows 7 Ultimate。
先谢谢了:)