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文件方法项目根目录,就编译通过了!

  • 相关阅读:
    制作Autorun的CD
    Sybase ASE MDA tables 装不上怎么办?
    对于TStringList.Find函数,我有话要说
    HH.exe CHM Operator Command.
    Delphi 7的一些常用的快捷键
    Explain Plan
    在Delphi中的Log
    subst windows下实用的磁盘映射工具
    Excel 2007 如何冻结多行&多列
    LinqToDataTable[转]
  • 原文地址:https://www.cnblogs.com/time-is-life/p/8672230.html
Copyright © 2011-2022 走看看