能不能给我说下如何在mfc中使用agg呢? 
我把agg编译成静态链接库,做个Win32程序运行Damo是没有问题的 
可是如何把agg放到mfc中呢? 
我把.h文件和lib文件放入mfc项目文件夹中,再link了lib文件,在OnDraw中画了条线。 
代码没有问题,是使用hdc_randerer对图形进行转换。报错如下: hdc_renderer.obj : error LNK2005: "public: void __thiscall hdc_renderer::color(struct agg::rgba8)" (?color@hdc_renderer@@QAEXUrgba8@agg@@@Z) already defined in mfcView.obj 
hdc_renderer.obj : error LNK2005: "private: void __thiscall hdc_renderer::draw_solid_span(int,int,int)const " (?draw_solid_span@hdc_renderer@@ABEXHHH@Z) already defined in mfcView.obj 
hdc_renderer.obj : error LNK2005: "private: void __thiscall hdc_renderer::blend_pixel(int,int,unsigned int)const " (?blend_pixel@hdc_renderer@@ABEXHHI@Z) already defined in mfcView.obj 
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library 
agg.lib(agg_platform_support.obj) : error LNK2001: unresolved external symbol "int __cdecl agg_main(int,char * * const)" (?agg_main@@YAHHQAPAD@Z) 
Debug/mfc.exe : fatal error LNK1120: 1 unresolved externals 
Error executing link.exe. mfc.exe - 5 error(s), 1 warning(s) 我想可能是哪里配置出了问题了。
很困惑

解决方案 »

  1.   

    agg项目和mfc项目运行时库设为一样的试试
      

  2.   

    根据错误提示我改了hdc_renderer的代码,错误只有两个了Searching for 'agg_main'...
    C:\WORK\SVG\LIB\3\mfc\platform\agg_platform_support.h(399):    //  int agg_main(int argc, char* argv[])
    C:\WORK\SVG\LIB\3\mfc\platform\agg_platform_support.h(411):    // The reason to have agg_main() instead of just main() is that SDL
    2 occurrence(s) have been found.很显然,还是连接问题agg.lib(agg_platform_support.obj) : error LNK2001: unresolved external symbol "int __cdecl agg_main(int,char * * const)" (?agg_main@@YAHHQAPAD@Z) 
      

  3.   

    --------------------Configuration: MyMfc - Win32 Debug--------------------
    Compiling...
    StdAfx.cpp
    Compiling...
    MyMfc.cpp
    MainFrm.cpp
    MyMfcDoc.cpp
    MyMfcView.cpp
    Generating Code...
    Linking...
    LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library
    agg.lib(agg_platform_support.obj) : error LNK2001: unresolved external symbol "int __cdecl agg_main(int,char * * const)" (?agg_main@@YAHHQAPAD@Z)
    Debug/MyMfc.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.MyMfc.exe - 2 error(s), 1 warning(s)
      

  4.   

    不是,agg是一个轻量级的图形库,做这个的人不多,只能先到maillist去看看了
      

  5.   

    我在maillist里找到答案了。。
      

  6.   

    这个矢量图形库更加强大。
    http://picasso-graphic.googlecode.com/files/picasso_0.9_beta1.zip
      

  7.   

    Picasso 矢量图型库更新
    http://code.google.com/p/picasso-graphic/
      

  8.   

    你的工程包含了 agg/platform/agg_platform_support.cpp
    一旦包含这个文件,就要求用户实现 agg_main() 函数,但你没有实现。这个文件是开发AGG的DEMO用的,是AGG Demo的入口函数。
    你可以不包含这个CPP。
    实际上你要用AGG的话不需要把 platform,ctrl,util里面的文件加到工程里。这些都是特定平台的控件,用于快速开发DEMO用。
      

  9.   

    楼主的实例可否发给在下一份,就是那个用agg封装图形库后,然后做的win32应用程序