zoukankan      html  css  js  c++  java
  • FreeType的项目总是报error LNK2019: unresolved external symbol __imp错误

    用vs2013建立了一个c++的项目,然后在根目录放置了freetype.lib,将GitHub上面的include文件夹拷贝到本机,并且在VS中设置了额外包含目录指向这个inluce文件夹,然后将freetype.dll拷贝到Debug目录下,然后程序中用了如下的代码:

    #include "stdafx.h"

    #include "FreeTypeHelper.h"

    #include <ft2build.h>

    #include "freetype/freetype.h"

    #include FT_FREETYPE_H

     

    #pragma comment(lib, "freetype")

     

     

     

    int FreeTypeHelper::Test1()

    {

        FT_Library library;

        FT_Init_FreeType(&library); //加上这句后报错

     

        return 0;

    }

     

    编译的时候,如果加上上面的一句总是报错:

    error LNK2019: unresolved external symbol __imp__FT_Init_FreeType referenced in function "public: int __thiscall FreeTypeHelper::Test1(void)" (?Test1@FreeTypeHelper@@QAEHXZ)

     

    FT_Init_FreeType上面Go To Definition, 发现定位到了freetype.h里面,用dumbbin /exports freetype.dll查看,发现DLL中也有这个方法。

    到底是怎么回事那?

    【解决方法】

    我从Github上面下载的是64位的lib文件,重新下载32位的lib文件方法项目根目录,就编译通过了!

  • 相关阅读:
    Chapter 12 homework
    copy construction note
    Chapter 11 homework
    数组排序最大元素
    temporary Object and destructor
    strcpy() 函数注意的地方
    结对项目第二次作业
    结队项目——第一次作业
    软件工程实践2017第二次作业
    软件工程实践2017第一次作业
  • 原文地址:https://www.cnblogs.com/time-is-life/p/8672230.html
Copyright © 2011-2022 走看看