我想为Visual构建解决方案。
据我所知,它的最小值是cmake、zlib、jpeg和freetype。
我构建了免费类型(调试和更新)。
下载编译的zlib dll。
(对于Visual,您需要使用Visual的版本构建libjpeg。从这里下载libjpeg源代码并将它们解压缩到一个工作目录中。我假设您使用了C:\Developer\jpeg。将源代码解压缩后,启动visual studio命令提示符并将cd转换为c:\developer\jpeg,然后运行jconfig.vc jconfig.h,然后运行nmake /f makefile.vc /a)
Jpeg已经完成了,还是我还需要做点什么呢?
然后我创建cmd文件:
del cmakecache.txt
set FTDIR=C:\dev\freetype-2.4.5
set FTLIBDIR=C:\dev\freetype-2.4.5\objs\win32\vc2010
set JPEGDIR=C:\dev\jpeg
set ZLIBDIR=C:\developer\zlib128-dll
cmake -G "Visual Studio 10" c:\dev\podofo-0.9.2\ -DCMAKE_INCLUDE_PATH="%FTDIR%\include;%JPEGDIR%\include;%JPEGDIR%;%ZLIBDIR%\include" -DCMAKE_LIBRARY_PATH="%FTLIBDIR%;%FTDIR%\lib;%JPEGDIR%;%JPEGDIR%;%ZLIBDIR%\lib" -DPODOFO_BUILD_SHARED:BOOL=FALSE -DFREETYPE_LIBRARY_NAMES_DEBUG=freetype245MT_D -DFREETYPE_LIBRARY_NAMES_RELEASE=freetype245MT -DCMAKE_BUILD_TYPE=DEBUG然后我就能看到:
-- Looking for strings.h
-- Looking for strings.h - not found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - not found
-- Looking for winsock2.h
-- Looking for winsock2.h - found
-- Looking for mem.h
-- Looking for mem.h - not found
-- Looking for ctype.h
-- Looking for ctype.h - found这可能是问题所在,也可能是jpeg lib中的问题。
发布于 2014-01-30 18:32:13
我建议您使用cmake构建PoDoFo,而不是直接使用nmake。不要编写自己的build.cmd,因为这在大多数情况下都不起作用。备注:下面描述的方法使用您的方法,不要遵循它。使用cmake (如果您不知道cmake或nmake的工作原理)。
那么,我将建议您访问这个站点并找到参考资料:用MSVS 2012构建静态podofo,好吧,我想这对于Visual 2010应该是有效的。记住:
- Unresolved externals (either with msvcrt.lib or libcmt.lib). In that case, just go to **Linker>Input>Ignore specific libraries** and name that library there to just ignore it.
- There will be random errors sometimes. I would suggest looking up Stack Overflow itself or MSDN or Google, because after starting off with >2500 errors I was finally able to build a static library.
https://stackoverflow.com/questions/17967335
复制相似问题