g++ finstrument-functions opencv

shihyuyao 2013-09-18 08:51:38
cmake -D CMAKE_INSTALL_PREFIX=/usr/ local/opencv -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_C_FLAGS=-finstrument - functions -g -D CMAKE_CXX_FLAGS=-finstrument- functions -g ..


有人在opencv使用finstrument-functions ? 上面是我编译的配置,有人成功过吗可以分享一下步骤吗?
...全文
91 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
shihyuyao 2013-09-18
  • 打赏
  • 举报
回复
直接 ./configure make 編譯出來好像沒有作用只會打印出local 函數地址 , opencv library 函數地址都沒顯示 g++ `pkg-config --cflags opencv` `pkg-config --libs opencv` -I/usr/local/opencv/include -finstrument-functions -g main.cpp -o main
#include "opencv.h"
#include     <fstream> 
#include     <iomanip> 
#include     <iostream>
#include <cstdlib> 
#include     <cstdlib> 
using namespace std;
using namespace cv;

#if 1
#define DUMP(func, call) printf("%s: func = %p, called by = %p\n", __FUNCTION__, func, call)
#ifdef __cplusplus
extern  "C" {
     #endif 
    /* Static functions. */ 
    static FILE *openlogfile ( const  char * filename)
                __attribute__ ((no_instrument_function));
    static  void closelogfile ( void )
                __attribute__ ((no_instrument_function));

    /* Note that these are linked internally by the compiler.
     *  * Don't call them directly! */ 
    void __cyg_profile_func_enter ( void *this_fn, void * call_site)
                __attribute__ ((no_instrument_function));
    void __cyg_profile_func_exit ( void *this_fn, void * call_site)
                __attribute__ ((no_instrument_function));

#ifdef __cplusplus
};
#endif

void 
__cyg_profile_func_enter ( void *this_fn, void * call_site)
{
        DUMP(this_fn, call_site);
}

void 
__cyg_profile_func_exit ( void *this_fn, void * call_site)
{
       DUMP(this_fn, call_site);
}
#endif

int main(int argc, char* argv[])
{
    IplImage *gimg = cvLoadImage("lena.bmp", 0);

    BwImage gimgA(gimg);

    gimgA[0][0] = 0;
    gimgA[0][1] = 0;
    gimgA[0][2] = 0;

    cvNamedWindow("Bitmap",0);
    cvShowImage("Bitmap",gimg);
    cvWaitKey(0);
    cout << gimg->height << endl;
    cout << gimg->depth << endl;
	return 0;
}
hustgonia 2013-09-18
  • 打赏
  • 举报
回复
坚决消灭令恢复。
ForestDB 2013-09-18
  • 打赏
  • 举报
回复
不如先试试“默认”,即 ./configure make

69,372

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧