问题描述
我正在尝试使用Andy Sloane's TextureSynth在Windows中编译GnuWin32's gd for windows,我成功地编译了gen.cpp和img.cpp,但是当尝试将obj文件与libgd.lib链接时,Microsoft的链接随地吐痰出现以下错误:
img.obj : error LNK2019: external symbol _gdImageCreateTrueColor without resolving referenced in the function "public: bool __thiscall Img::save_png(char const *)" (?save_png@Img@@QAE_NPBD@Z)
img.obj : error LNK2019: external symbol _gdimagecreatefrompng without resolving referenced in the function "public: static class Img * __cdecl Img::load_png(char const *)" (?load_png@Img@@SAPAV1@PBD@Z)
img.obj : error LNK2019: external symbol _gdImageDestroy without resolving referenced in the function "public: static class Img * __cdecl Img::load_png(char const *)" (?load_png@Img@@SAPAV1@PBD@Z)
img.obj : error LNK2019: external symbol _gdimagesetPixel sin resolver al que se hace referencia en la función "public: bool __thiscall Img::save_png(char const *)" (?save_png@Img@@QAE_NPBD@Z)
img.obj : error LNK2019: external symbol _gdImageGetPixel without resolving referenced in the function "public: static class Img * __cdecl Img::load_png(char const *)" (?load_png@Img@@SAPAV1@PBD@Z)
img.obj : error LNK2019: external symbol _gdImagePng without resolving referenced in the function "public: bool __thiscall Img::save_png(char const *)" (?save_png@Img@@QAE_NPBD@Z)
gen.exe : Fatal error LNK1120: 6 unresolved external symbols
我修改了img.cpp的第一行,现在他们说:
#define BGDWIN32
#include <stdlib.h>
#include <stdio.h>
#include "inc\gd.h"
#include "img.h"
命令是:
cl /c img.cpp
cl /c gen.cpp
link gen.obj img.obj .\lib\libgd.lib
我不知道为什么会这样,有人知道解决这个问题的方法吗? 谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)