这到底哪除了问题,为什么会执行时会提示 fatal error c1083LNK1120: 1 unresolved externals

【未解决】Python中安装mmseg时编译出错:LINK : error LNK2001: 无法解析的外部符号 initmmseg
想要在当前的:
python 2.7.2
上安装mmseg:
结果setup.py install时出现error: Unable to find vcvarsall.bat,已经解决了:
但是编译过程中却又出现:
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0&SET VS90COMNTOOLS=%VS100COMNTOOLS%
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0&setup.py install
running install
running bdist_egg
running egg_info
writing mmseg.egg-info\PKG-INFO
writing top-level names to mmseg.egg-info\top_level.txt
writing dependency_links to mmseg.egg-info\dependency_links.txt
reading manifest file 'mmseg.egg-info\SOURCES.txt'
writing manifest file 'mmseg.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
building 'mmseg' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\mmseg
creating build\temp.win-amd64-2.7\Release\mmseg\mmseg_cpp
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\dev_in
stall_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg/mmseg_cpp/algor.cpp /Fobuild\temp.win-amd64-2.7\R
elease\mmseg/mmseg_cpp/algor.obj -O3
cl: 命令行 warning D9002 :忽略未知选项“-O3”
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(31) : warning C4267: “=”: 从“size_t”转换到“int
”,可能丢失数据
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(38) : warning C4996: 'strncpy': This function or va
riable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(188) : 参见“strncpy”的声明
mmseg/mmseg_cpp/algor.cpp(210) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strnc
py_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(188) : 参见“strncpy”的声明
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(537) : warning C4530: 使用了 C++ 异常处理程序,但
未启用展开语义。请指定 /EHsc
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(533): 编译类 模板 成员函数“std::vector&_T
y&::vector(const std::vector&_Ty& &)”时
_Ty=rmmseg::Word *
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\utility(167): 参见对正在编译的类 模板 实例化“std
::vector&_Ty&”的引用
_Ty=rmmseg::Word *
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\utility(174): 参见对正在编译的类 模板 实例化“std
::_Pair_base&_Ty1,_Ty2&”的引用
_Ty2=std::vector&rmmseg::Word *&
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\algor.h(75): 参见对正在编译的类 模板 实例化“std::
pair&_Ty1,_Ty2&”的引用
_Ty2=std::vector&rmmseg::Word *&
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\dev_in
stall_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg/mmseg_cpp/dict.cpp /Fobuild\temp.win-amd64-2.7\Re
lease\mmseg/mmseg_cpp/dict.obj -O3
cl: 命令行 warning D9002 :忽略未知选项“-O3”
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(31) : warning C4267: “=”: 从“size_t”转换到“int
”,可能丢失数据
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(38) : warning C4996: 'strncpy': This function or va
riable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(188) : 参见“strncpy”的声明
mmseg/mmseg_cpp/dict.cpp(73) : warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据
mmseg/mmseg_cpp/dict.cpp(178) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(234) : 参见“fopen”的声明
mmseg/mmseg_cpp/dict.cpp(205) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(234) : 参见“fopen”的声明
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\dev_in
stall_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg/mmseg_cpp/memory.cpp /Fobuild\temp.win-amd64-2.7\
Release\mmseg/mmseg_cpp/memory.obj -O3
cl: 命令行 warning D9002 :忽略未知选项“-O3”
memory.cpp
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\dev_in
stall_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg/mmseg_cpp/mmseg.cpp /Fobuild\temp.win-amd64-2.7\R
elease\mmseg/mmseg_cpp/mmseg.obj -O3
cl: 命令行 warning D9002 :忽略未知选项“-O3”
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(31) : warning C4267: “=”: 从“size_t”转换到“int
”,可能丢失数据
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(38) : warning C4996: 'strncpy': This function or va
riable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(188) : 参见“strncpy”的声明
mmseg/mmseg_cpp/mmseg.cpp(61) : warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据
mmseg/mmseg_cpp/mmseg.cpp(90) : warning C4244: “=”: 从“__int64”转换到“int”,可能丢失数据
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:E:\dev_i
nstall_root\Python27\libs /LIBPATH:E:\dev_install_root\Python27\PCbuild\amd64 /EXPORT:initmmseg build\temp.win-amd64-2.7
\Release\mmseg/mmseg_cpp/algor.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/dict.obj build\temp.win-amd64-2.7\Re
lease\mmseg/mmseg_cpp/memory.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/mmseg.obj /OUT:build\lib.win-amd64-2.7
\mmseg.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Rel
ease\mmseg/mmseg_cpp\mmseg.pyd.manifest
LINK : error LNK2001: 无法解析的外部符号 initmmseg
build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib : fatal error LNK1120: 1 个无法解析的外部命令
error: command '&c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe&' failed with exit status 112
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0&
即,最后出现:
LINK : error LNK2001: 无法解析的外部符号 initmmseg
【解决过程】
1.对应的部分是:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe
时,传递的参数中包含的:
/EXPORT:initmmseg
此处很明显,找不到函数initmmseg,所以无法无法继续链接。
python initmmseg
其中也和我遇到同样问题:
Building on ('Windows', 'apy-win64', '2003Server', '5.2.3790', 'AMD64', 'EM64T Family 6 Model 30 Stepping 5, GenuineIntel') with Python-2.6.4 (r264:75706, Nov
3 :08) [MSC v.1500 64 bit (AMD64)] at
23:41:11.822000 (utc)
Extracting REMOTE-LOC\languages\pypm\infinitude.be\data\m\mm\mmseg\mmseg-1.2.2.tar.gz
******** Running build command *******
C:\ActivePython64Python26\Python.exe setup.py install --no-compile --root=_pypm_install_root
[SetupPyBuildFailed] non-zero returncode: 1
command: C:\ActivePython64Python26\Python.exe setup.py install --no-compile --root=_pypm_install_root
pwd: c:\docume~1\apy\locals~1\temp\tmplpxbp0\mmseg-1.2.2
running install
running build
running build_py
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python26\libs /LIBPATH:C:\Python26\PCbuild\amd64 /EXPORT:initmmseg build\temp.win-amd64-2.6\Release\mmseg/mmseg_cpp/algor.obj build\temp.win-amd64-2.6\Release\mmseg/mmseg_cpp/dict.obj build\temp.win-amd64-2.6\Release\mmseg/mmseg_cpp/memory.obj build\temp.win-amd64-2.6\Release\mmseg/mmseg_cpp/mmseg.obj /OUT:build\lib.win-amd64-2.6\mmseg.pyd /IMPLIB:build\temp.win-amd64-2.6\Release\mmseg/mmseg_cpp\mmseg.lib /MANIFESTFILE:build\temp.win-amd64-2.6\Release\mmseg/mmseg_cpp\mmseg.pyd.manifest
LINK : error LNK2001: unresolved external symbol initmmseg
3.突然想到,会不会是版本的问题。
所以,去换个版本试试。
下载得到mmseg-1.2.4.tar.gz,解压,打开cmd切换到对应目录,运行
SET VS90COMNTOOLS=%VS100COMNTOOLS%
setup.py install
结果错误依旧,还是:
build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib : fatal error LNK1120: 1 个无法解析的外部命令
4.后来在参考:
@Gili: It looks like this problem is due to spaces in the variable, try wrapping it within quotes. For me %VS100COMNTOOLS%=&C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools& –
结果自己去我的目录:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
中看了看,无意间发现了其下有:
vsvars32.bat
打开看了看,内容大概是:
@echo Setting environment for using Microsoft Visual Studio 2010 x86 tools.
@call :GetVSCommonToolsDir
@if &%VS100COMNTOOLS%&==&& goto error_no_VS100COMNTOOLSDIR
@call &%VS100COMNTOOLS%VCVarsQueryRegistry.bat& 32bit No64bit
:error_no_Framework35Version
@echo ERROR: Cannot determine the .NET Framework 3.5 version.
而且,也去看了看
VS100COMNTOOLS
环境变量,其内容也本身就是:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
5.至此,貌似环境变量方面都是正常的。
再去随便折腾一下,把:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat
拷贝出来一份,重命名为
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\vcvarsall.bat
然后再执行:
SET VS90COMNTOOLS=%VS100COMNTOOLS%
setup.py install
看看结果,结果竟然真的可以了:
E:\Dev_Tools\python\modules\mmseg\mmseg-1.2.4&SET VS90COMNTOOLS=%VS100COMNTOOLS%
E:\Dev_Tools\python\modules\mmseg\mmseg-1.2.4&setup.py install
running install
running bdist_egg
running egg_info
writing mmseg.egg-info\PKG-INFO
writing top-level names to mmseg.egg-info\top_level.txt
writing dependency_links to mmseg.egg-info\dependency_links.txt
reading manifest file 'mmseg.egg-info\SOURCES.txt'
writing manifest file 'mmseg.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\mmseg
creating build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\chars.dic -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\test.py -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\words.dic -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\__init__.py -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\search.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\word2.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\_mmseg.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\__init__.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg.pyd -& build\bdist.win-amd64\egg
byte-compiling build\bdist.win-amd64\egg\mmseg\data\test.py to test.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\data\__init__.py to __init__.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\search.py to search.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\word2.py to word2.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\_mmseg.py to _mmseg.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\__init__.py to __init__.pyc
creating stub loader for mmseg.pyd
byte-compiling build\bdist.win-amd64\egg\mmseg.py to mmseg.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\PKG-INFO -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\SOURCES.txt -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\dependency_links.txt -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\top_level.txt -& build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_ analyzing archive contents...
mmseg._mmseg: module references __file__
creating dist
creating 'dist\mmseg-1.2.4-py2.7-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing mmseg-1.2.4-py2.7-win-amd64.egg
creating e:\dev_install_root\python27\lib\site-packages\mmseg-1.2.4-py2.7-win-amd64.egg
Extracting mmseg-1.2.4-py2.7-win-amd64.egg to e:\dev_install_root\python27\lib\site-packages
Adding mmseg 1.2.4 to easy-install.pth file
Installed e:\dev_install_root\python27\lib\site-packages\mmseg-1.2.4-py2.7-win-amd64.egg
Processing dependencies for mmseg==1.2.4
Finished processing dependencies for mmseg==1.2.4
E:\Dev_Tools\python\modules\mmseg\mmseg-1.2.4&
6.再去试试1.3.0的版本,是否也可以正常安装。结果也是可以的:
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0&SET VS90COMNTOOLS=%VS100COMNTOOLS%
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0&setup.py install
running install
running bdist_egg
running egg_info
writing mmseg.egg-info\PKG-INFO
writing top-level names to mmseg.egg-info\top_level.txt
writing dependency_links to mmseg.egg-info\dependency_links.txt
reading manifest file 'mmseg.egg-info\SOURCES.txt'
writing manifest file 'mmseg.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\mmseg
creating build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\chars.dic -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\test.py -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\word2_gen.py -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\words.dic -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\word_in_word_rm.py -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\__init__.py -& build\bdist.win-amd64\egg\mmseg\data
creating build\bdist.win-amd64\egg\mmseg\mmseg_cpp
copying build\lib.win-amd64-2.7\mmseg\mmseg_cpp\__init__.py -& build\bdist.win-amd64\egg\mmseg\mmseg_cpp
copying build\lib.win-amd64-2.7\mmseg\search.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\word2.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\_mmseg.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\__init__.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg.pyd -& build\bdist.win-amd64\egg
byte-compiling build\bdist.win-amd64\egg\mmseg\data\test.py to test.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\data\word2_gen.py to word2_gen.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\data\word_in_word_rm.py to word_in_word_rm.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\data\__init__.py to __init__.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\mmseg_cpp\__init__.py to __init__.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\search.py to search.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\word2.py to word2.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\_mmseg.py to _mmseg.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\__init__.py to __init__.pyc
creating stub loader for mmseg.pyd
byte-compiling build\bdist.win-amd64\egg\mmseg.py to mmseg.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\PKG-INFO -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\SOURCES.txt -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\dependency_links.txt -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\top_level.txt -& build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_ analyzing archive contents...
mmseg._mmseg: module references __file__
mmseg.data.word2_gen: module references __file__
mmseg.data.word_in_word_rm: module references __file__
creating dist
creating 'dist\mmseg-1.3.0-py2.7-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing mmseg-1.3.0-py2.7-win-amd64.egg
creating e:\dev_install_root\python27\lib\site-packages\mmseg-1.3.0-py2.7-win-amd64.egg
Extracting mmseg-1.3.0-py2.7-win-amd64.egg to e:\dev_install_root\python27\lib\site-packages
Removing mmseg 1.2.4 from easy-install.pth file
Adding mmseg 1.3.0 to easy-install.pth file
Installed e:\dev_install_root\python27\lib\site-packages\mmseg-1.3.0-py2.7-win-amd64.egg
Processing dependencies for mmseg==1.3.0
Finished processing dependencies for mmseg==1.3.0
并且可以看到,上面先是
Removing mmseg 1.2.4 from easy-install.pth file
Adding mmseg 1.3.0 to easy-install.pth file
是可以自动升级的。
7.本以为都正常了,结果,实际上并没有。
因为去运行代码时,又出现
WindowsError: [Error 126]
的错误了,详见:
8.所以,还是先要解决此处的链接问题,才能解决后面的代码运行dll导入出错的问题。
9.对于此处的initmmseg,网站能找到的,基本上就唯一一个:
不过后来真的找到了相关的:
中有initmmseg函数的:
PyMODINIT_FUNC
initmmseg(void)
PyObject *m;
m = Py_InitModule(&mmseg&, Methods);
if (m == NULL)
Error = PyErr_NewException(&mmseg.error&, NULL, NULL);
Py_INCREF(Error);
PyModule_AddObject(m, &error&, Error);
所以,很明显,此处,是有此initmmseg函数的,只是之前编译或链接时,没能很好的整合而导致后面链接时找不到此initmmseg函数。
10.后来也查到了微软的 /EXPORT 的语法:
所以,此处很明显,就是,在link的时候,会导出initmmseg,但是,在对应的
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\mmseg.cpp
中,也没有找到initmmseg函数,导致刚才网上搜到的那里:
里面有initmmseg函数。
但是,网上的这个mmseg.cpp比本地的mmseg-1.3.0中的内容少多了。
python-mmseg-master.zip
解压后,打开cmd,进入目录,去安装,结果又是其他错误:
E:\Dev_Tools\python\modules\mmseg\python-mmseg-master&SET VS90COMNTOOLS=%VS100COMNTOOLS%
E:\Dev_Tools\python\modules\mmseg\python-mmseg-master&setup.py install
running install
running build
running build_ext
building 'mmseg' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/opt/loca
l/include/mmseg -IE:\dev_install_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg.cpp /Fobuild\temp.win-
amd64-2.7\Release\mmseg.obj
mmseg.cpp : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323) : warning C4530: 使用了 C++ 异常处理程序,但
未启用展开语义。请指定 /EHsc
mmseg.cpp(4) : fatal error C1083: 无法打开包括文件:“SegmenterManager.h”: No such file or directory
error: command '&c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe&' failed with exit status 2
E:\Dev_Tools\python\modules\mmseg\python-mmseg-master&
12.此处一直想要找到,到底是哪里去设置了参数,去添加了link的参数:
/EXPORT:initmmseg
的,但是一直都没找到。
唯一能看到的是,关于
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0\setup.py
中有对应的文件依赖的说明:
ext_modules=[
Extension(
mmseg/mmseg_cpp/algor.cpp
mmseg/mmseg_cpp/dict.cpp
mmseg/mmseg_cpp/memory.cpp
mmseg/mmseg_cpp/mmseg.cpp
&&&.split(),
extra_compile_args=['-O3'],
depends=&&&
mmseg/mmseg_cpp/algor.h
mmseg/mmseg_cpp/dict.h
mmseg/mmseg_cpp/rules.h
mmseg/mmseg_cpp/word.h
mmseg/mmseg_cpp/chunk.h
mmseg/mmseg_cpp/memory.h
mmseg/mmseg_cpp/token.h
&&&.split(),
13.实在逼急了,自己手动去:
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\mmseg.cpp
中添加了一个initmmseg的空函数:
void initmmseg(void)
再去重新编译试试,看看效果。
结果导致其他错误了:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:E:\dev_i
nstall_root\Python27\libs /LIBPATH:E:\dev_install_root\Python27\PCbuild\amd64 /EXPORT:initmmseg build\temp.win-amd64-2.7
\Release\mmseg/mmseg_cpp/algor.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/dict.obj build\temp.win-amd64-2.7\Re
lease\mmseg/mmseg_cpp/memory.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/mmseg.obj /OUT:build\lib.win-amd64-2.7
\mmseg.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Rel
ease\mmseg/mmseg_cpp\mmseg.pyd.manifest
mmseg.obj : warning LNK4197: 多次指定导出“initmmseg”;使用第一个规范
正在创建库 build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib 和对象 build\temp.win-amd64-2.7\Release\mmseg/m
mseg_cpp\mmseg.exp
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\x64\mt.exe -nologo -manifest build\temp.win-amd64-2.7\Release\mm
seg/mmseg_cpp\mmseg.pyd.manifest -outputresource:build\lib.win-amd64-2.7\mmseg.2
build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.pyd.manifest : general error c1010070: Failed to load and parse t
0vnifest. {_~
error: command 'mt.exe' failed with exit status 31
14.之前就猜测,不会是,setup.py的编译过程自己给某个模块添加了initxxx吧
即此处的给mmseg添加了initmmseg。
后来搜了下,参考:
果然提到这个问题了。
所以,还是去掉手动添加的那个initmmseg。
参考上面中提到的:
找到相关的解释了:
2.3.5. Other options
There are still some other options which can be used to handle special cases.
The extra_objects option is a list of object files to be passed to the linker. These files must not have extensions, as the default extension for the compiler is used.
extra_compile_args and extra_link_args can be used to specify additional command line options for the respective compiler and linker command lines.
export_symbols is only useful on Windows. It can contain a list of symbols (functions or variables) to be exported. This option is not needed when building compiled extensions: Distutils will automatically add initmodule to the list of exported symbols.
The depends option is a list of files that the extension depends on (for example header files). The build command will call the compiler on the sources to rebuild extension if any on this files has been modified since the previous build.
15.后来找到这里:
其也是遇到同样问题:
在linux下编译是OK的,但是windows下编译,生生的多出一个:
LINK : error LNK2001: unresolved external symbol inittest
也是由于distutils会去编译,会自动给“export_symbols ”添加上一个initXXX的函数。导致出错。
16.另外看到:
其中提到了msvccompiler.py,找了下,在这里:
E:\dev_install_root\Python27\Lib\distutils
msvccompiler.py
msvc9compiler.py
E:\dev_install_root\Python27\Lib\distutils\msvc9compiler.py
貌似也是上述提交的更新,修改后的版本。
17.手动去把
E:\dev_install_root\Python27\Lib\distutils\msvc9compiler.py
中把对应两行干掉:
# for sym in (export_symbols or []):
# export_opts.append(&/EXPORT:& + sym)
然后再去编译试试,即取消EXPORT试试,结果还是之前见过的,另外一个问题:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:E:\dev_i
nstall_root\Python27\libs /LIBPATH:E:\dev_install_root\Python27\PCbuild\amd64 build\temp.win-amd64-2.7\Release\mmseg/mms
eg_cpp/algor.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/dict.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_
cpp/memory.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/mmseg.obj /OUT:build\lib.win-amd64-2.7\mmseg.pyd /IMPLIB
:build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\mmseg/mmseg_c
pp\mmseg.pyd.manifest
正在创建库 build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib 和对象 build\temp.win-amd64-2.7\Release\mmseg/m
mseg_cpp\mmseg.exp
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\x64\mt.exe -nologo -manifest build\temp.win-amd64-2.7\Release\mm
seg/mmseg_cpp\mmseg.pyd.manifest -outputresource:build\lib.win-amd64-2.7\mmseg.2
build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.pyd.manifest : general error c1010070: Failed to load and parse t
0vnifest. {_~
error: command 'mt.exe' failed with exit status 31
所以,还是还原msvc9compiler.py回来吧。
18.后来终于看懂:
中的意思了,这人肯定是把
Extention中的
xxx.modulename
xxx/modulename
xxx.modulename
其中xxx是package即可。
但是我此处,不是我写的模块,是别人写的,而且好像也没用到package,所以对于此处问题,还是没有帮助,没法解决。
19.后来又找到一个同样的问题的:
但是没有人回答正确。。
20.又找到一个:
结果也没有有效的回答。。。
21.手动修改:
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0\setup.py
自己添加上:
export_symbols
ext_modules=[
Extension(
mmseg/mmseg_cpp/algor.cpp
mmseg/mmseg_cpp/dict.cpp
mmseg/mmseg_cpp/memory.cpp
mmseg/mmseg_cpp/mmseg.cpp
&&&.split(),
extra_compile_args=['-O3'],
depends=&&&
mmseg/mmseg_cpp/algor.h
mmseg/mmseg_cpp/dict.h
mmseg/mmseg_cpp/rules.h
mmseg/mmseg_cpp/word.h
mmseg/mmseg_cpp/chunk.h
mmseg/mmseg_cpp/memory.h
mmseg/mmseg_cpp/token.h
&&&.split(),
export_symbols=[],
结果问题依旧。
22.参考了:
E:\dev_install_root\Python27\Lib\distutils\msvc9compiler.py
中把export干掉,然后结果是这个:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:E:\dev_i
nstall_root\Python27\libs /LIBPATH:E:\dev_install_root\Python27\PCbuild\amd64 build\temp.win-amd64-2.7\Release\mmseg/mms
eg_cpp/algor.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/dict.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_
cpp/memory.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/mmseg.obj /OUT:build\lib.win-amd64-2.7\mmseg.pyd /IMPLIB
:build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\mmseg/mmseg_c
pp\mmseg.pyd.manifest
正在创建库 build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib 和对象 build\temp.win-amd64-2.7\Release\mmseg/m
mseg_cpp\mmseg.exp
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\x64\mt.exe -nologo -manifest build\temp.win-amd64-2.7\Release\mm
seg/mmseg_cpp\mmseg.pyd.manifest -outputresource:build\lib.win-amd64-2.7\mmseg.2
build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.pyd.manifest : general error c1010070: Failed to load and parse t
0vnifest. {_~
error: command 'mt.exe' failed with exit status 31
E:\dev_install_root\Python27\Lib\distutils\msvc9compiler.py
            ld_args.append(‘/MANIFESTFILE:’ + temp_manifest)
再前后再加一句,变成:
ld_args.append('/MANIFESTFILE:' + temp_manifest)
ld_args.append('/MANIFEST')
然后再去编译,最终终于正常编译了:
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0&SET VS90COMNTOOLS=%VS100COMNTOOLS%
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0&setup.py install
running install
running bdist_egg
running egg_info
writing mmseg.egg-info\PKG-INFO
writing top-level names to mmseg.egg-info\top_level.txt
writing dependency_links to mmseg.egg-info\dependency_links.txt
reading manifest file 'mmseg.egg-info\SOURCES.txt'
writing manifest file 'mmseg.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\mmseg
copying mmseg\search.py -& build\lib.win-amd64-2.7\mmseg
copying mmseg\word2.py -& build\lib.win-amd64-2.7\mmseg
copying mmseg\_mmseg.py -& build\lib.win-amd64-2.7\mmseg
copying mmseg\__init__.py -& build\lib.win-amd64-2.7\mmseg
creating build\lib.win-amd64-2.7\mmseg\data
copying mmseg\data\test.py -& build\lib.win-amd64-2.7\mmseg\data
copying mmseg\data\word2_gen.py -& build\lib.win-amd64-2.7\mmseg\data
copying mmseg\data\word_in_word_rm.py -& build\lib.win-amd64-2.7\mmseg\data
copying mmseg\data\__init__.py -& build\lib.win-amd64-2.7\mmseg\data
creating build\lib.win-amd64-2.7\mmseg\mmseg_cpp
copying mmseg\mmseg_cpp\__init__.py -& build\lib.win-amd64-2.7\mmseg\mmseg_cpp
copying mmseg\data\chars.dic -& build\lib.win-amd64-2.7\mmseg\data
copying mmseg\data\words.dic -& build\lib.win-amd64-2.7\mmseg\data
running build_ext
building 'mmseg' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\mmseg
creating build\temp.win-amd64-2.7\Release\mmseg\mmseg_cpp
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\dev_in
stall_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg/mmseg_cpp/algor.cpp /Fobuild\temp.win-amd64-2.7\R
elease\mmseg/mmseg_cpp/algor.obj -O3
cl: 命令行 warning D9002 :忽略未知选项“-O3”
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(31) : warning C4267: “=”: 从“size_t”转换到“int
”,可能丢失数据
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(38) : warning C4996: 'strncpy': This function or va
riable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(188) : 参见“strncpy”的声明
mmseg/mmseg_cpp/algor.cpp(210) : warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strnc
py_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(188) : 参见“strncpy”的声明
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(537) : warning C4530: 使用了 C++ 异常处理程序,但
未启用展开语义。请指定 /EHsc
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\vector(533): 编译类 模板 成员函数“std::vector&_T
y&::vector(const std::vector&_Ty& &)”时
_Ty=rmmseg::Word *
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\utility(167): 参见对正在编译的类 模板 实例化“std
::vector&_Ty&”的引用
_Ty=rmmseg::Word *
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\utility(174): 参见对正在编译的类 模板 实例化“std
::_Pair_base&_Ty1,_Ty2&”的引用
_Ty2=std::vector&rmmseg::Word *&
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\algor.h(75): 参见对正在编译的类 模板 实例化“std::
pair&_Ty1,_Ty2&”的引用
_Ty2=std::vector&rmmseg::Word *&
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\dev_in
stall_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg/mmseg_cpp/dict.cpp /Fobuild\temp.win-amd64-2.7\Re
lease\mmseg/mmseg_cpp/dict.obj -O3
cl: 命令行 warning D9002 :忽略未知选项“-O3”
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(31) : warning C4267: “=”: 从“size_t”转换到“int
”,可能丢失数据
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(38) : warning C4996: 'strncpy': This function or va
riable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(188) : 参见“strncpy”的声明
mmseg/mmseg_cpp/dict.cpp(73) : warning C4267: “初始化”: 从“size_t”转换到“int”,可能丢失数据
mmseg/mmseg_cpp/dict.cpp(178) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(234) : 参见“fopen”的声明
mmseg/mmseg_cpp/dict.cpp(205) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(234) : 参见“fopen”的声明
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\dev_in
stall_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg/mmseg_cpp/memory.cpp /Fobuild\temp.win-amd64-2.7\
Release\mmseg/mmseg_cpp/memory.obj -O3
cl: 命令行 warning D9002 :忽略未知选项“-O3”
memory.cpp
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IE:\dev_in
stall_root\Python27\include -IE:\dev_install_root\Python27\PC /Tpmmseg/mmseg_cpp/mmseg.cpp /Fobuild\temp.win-amd64-2.7\R
elease\mmseg/mmseg_cpp/mmseg.obj -O3
cl: 命令行 warning D9002 :忽略未知选项“-O3”
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(31) : warning C4267: “=”: 从“size_t”转换到“int
”,可能丢失数据
e:\dev_tools\python\modules\mmseg\mmseg-1.3.0\mmseg\mmseg_cpp\word.h(38) : warning C4996: 'strncpy': This function or va
riable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online
help for details.
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\string.h(188) : 参见“strncpy”的声明
mmseg/mmseg_cpp/mmseg.cpp(61) : warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据
mmseg/mmseg_cpp/mmseg.cpp(90) : warning C4244: “=”: 从“__int64”转换到“int”,可能丢失数据
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:E:\dev_i
nstall_root\Python27\libs /LIBPATH:E:\dev_install_root\Python27\PCbuild\amd64 build\temp.win-amd64-2.7\Release\mmseg/mms
eg_cpp/algor.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/dict.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_
cpp/memory.obj build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp/mmseg.obj /OUT:build\lib.win-amd64-2.7\mmseg.pyd /IMPLIB
:build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\mmseg/mmseg_c
pp\mmseg.pyd.manifest /MANIFEST
正在创建库 build\temp.win-amd64-2.7\Release\mmseg/mmseg_cpp\mmseg.lib 和对象 build\temp.win-amd64-2.7\Release\mmseg/m
mseg_cpp\mmseg.exp
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\x64\mt.exe -nologo -manifest build\temp.win-amd64-2.7\Release\mm
seg/mmseg_cpp\mmseg.pyd.manifest -outputresource:build\lib.win-amd64-2.7\mmseg.2
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\mmseg
creating build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\chars.dic -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\test.py -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\word2_gen.py -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\words.dic -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\word_in_word_rm.py -& build\bdist.win-amd64\egg\mmseg\data
copying build\lib.win-amd64-2.7\mmseg\data\__init__.py -& build\bdist.win-amd64\egg\mmseg\data
creating build\bdist.win-amd64\egg\mmseg\mmseg_cpp
copying build\lib.win-amd64-2.7\mmseg\mmseg_cpp\__init__.py -& build\bdist.win-amd64\egg\mmseg\mmseg_cpp
copying build\lib.win-amd64-2.7\mmseg\search.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\word2.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\_mmseg.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg\__init__.py -& build\bdist.win-amd64\egg\mmseg
copying build\lib.win-amd64-2.7\mmseg.pyd -& build\bdist.win-amd64\egg
byte-compiling build\bdist.win-amd64\egg\mmseg\data\test.py to test.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\data\word2_gen.py to word2_gen.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\data\word_in_word_rm.py to word_in_word_rm.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\data\__init__.py to __init__.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\mmseg_cpp\__init__.py to __init__.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\search.py to search.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\word2.py to word2.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\_mmseg.py to _mmseg.pyc
byte-compiling build\bdist.win-amd64\egg\mmseg\__init__.py to __init__.pyc
creating stub loader for mmseg.pyd
byte-compiling build\bdist.win-amd64\egg\mmseg.py to mmseg.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\PKG-INFO -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\SOURCES.txt -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\dependency_links.txt -& build\bdist.win-amd64\egg\EGG-INFO
copying mmseg.egg-info\top_level.txt -& build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_ analyzing archive contents...
mmseg._mmseg: module references __file__
mmseg.data.word2_gen: module references __file__
mmseg.data.word_in_word_rm: module references __file__
creating dist
creating 'dist\mmseg-1.3.0-py2.7-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing mmseg-1.3.0-py2.7-win-amd64.egg
removing 'e:\dev_install_root\python27\lib\site-packages\mmseg-1.3.0-py2.7-win-amd64.egg' (and everything under it)
creating e:\dev_install_root\python27\lib\site-packages\mmseg-1.3.0-py2.7-win-amd64.egg
Extracting mmseg-1.3.0-py2.7-win-amd64.egg to e:\dev_install_root\python27\lib\site-packages
mmseg 1.3.0 is already the active version in easy-install.pth
Installed e:\dev_install_root\python27\lib\site-packages\mmseg-1.3.0-py2.7-win-amd64.egg
Processing dependencies for mmseg==1.3.0
Finished processing dependencies for mmseg==1.3.0
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0&
23.不过,白高兴一场,因为最后,去测试mmseg,还是同样的错误:
E:\Dev_Root\python\try_mmseg&try_mmseg.py
Traceback (most recent call last):
File &E:\Dev_Root\python\try_mmseg\try_mmseg.py&, line 13, in &module&
from mmseg import seg_
File &E:\dev_install_root\Python27\lib\site-packages\mmseg-1.3.0-py2.7-win-amd64.egg\mmseg\__init__
import _mmseg as mmseg
File &E:\dev_install_root\Python27\lib\site-packages\mmseg-1.3.0-py2.7-win-amd64.egg\mmseg\_mmseg.p
mmseg = cdll.LoadLibrary(mmseg_lib_path)
File &E:\dev_install_root\Python27\lib\ctypes\__init__.py&, line 431, in LoadLibrary
return self._dlltype(name)
File &E:\dev_install_root\Python27\lib\ctypes\__init__.py&, line 353, in __init__
self._handle = _dlopen(self._name, mode)
即,根本还是无法正常生成动态链接库,无法使用。
只不过,上述编译成lib,导致正常了。。。
经历千辛万苦,虽然编译成功了,但是结果还是没用的。
因为还是无法正常使用代码。
目前,已知的是:
知道了此处的问题,就是由于EXPORT对应的initXXX函数,但是initXXX找不到而导致link时报错;
此处对应的是
中解释的:
export_symbols is only useful on Windows. It can contain a list of symbols (functions or variables) to be exported. This option is not needed when building compiled extensions: Distutils will automatically add initmodule to the list of exported symbols.
但是,除了手动去改动
E:\dev_install_root\Python27\Lib\distutils\msvc9compiler.py
把对应的添加EXPORT的代码干掉,其他还真不知道如何取消此export。
但是归根结底,即使编译成功,但是还是无法正常使用此处的mmseg。。。
分类目录分类目录
选择分类目录
Uncategorized&&(10)
单身恋爱婚姻家庭&&(112)
&&&Lovestory&&(7)
&&&单身&&(21)
&&&婚姻&家庭&&(34)
&&&恋爱&&(46)
哲理 人生 故事&&(210)
&&&哲理佳句&&(39)
&&&电视剧《天道》&&(6)
&&&财富人生&&(44)
工作和技术&&(3,661)
&&&CharEncoding&&(3)
&&&CodeShare&&(17)
&&&CompilerLinkerParser&&(94)
&&&&&&ANTLR&&(92)
&&&&&&JavaCC&&(1)
&&&DevToolSoft&&(74)
&&&&&&Linux on Win&&(40)
&&&&&&&&&Cygwin&&(33)
&&&&&&&&&Gow&&(1)
&&&&&&&&&MingW&&(3)
&&&&&&&&&MSYS&&(3)
&&&&&&Putty&&(1)
&&&&&&Total Commander&&(2)
&&&&&&VersionControl&&(27)
&&&&&&&&&Git&&(18)
&&&&&&&&&SVN&&(7)
&&&Docbook&&(127)
&&&DocxyGen&&(1)
&&&Elance&&(6)
&&&Embedded&&(517)
&&&&&&BusyBox&&(2)
&&&&&&CrossCompiler&&(102)
&&&&&&&&&Buildroot&&(30)
&&&&&&&&&crosstool-ng&&(40)
&&&&&&Embedded Emulator&&(15)
&&&&&&&&&QEMU&&(15)
&&&&&&Embedded Filesystem&&(4)
&&&&&&&&&Yaffs2&&(2)
&&&&&&Embedded IDE&&(3)
&&&&&&&&&HEW&&(1)
&&&&&&&&&IAR&&(1)
&&&&&&Embedded OnChip Resource&&(2)
&&&&&&&&&Memory&&(2)
&&&&&&&&&&&&SDRAM&&(1)
&&&&&&Embedded OS&&(9)
&&&&&&&&&Realtime OS&&(2)
&&&&&&Embedded Peripherals&&(112)
&&&&&&&&&Bluetooth&&(21)
&&&&&&&&&CAN Bus&&(2)
&&&&&&&&&DMA&&(1)
&&&&&&&&&GPIO&&(1)
&&&&&&&&&Serial Communication&&(13)
&&&&&&&&&&&&RS232&&(10)
&&&&&&&&&&&&&&&SecureCRT&&(3)
&&&&&&&&&&&&RS485&&(2)
&&&&&&&&&Storage&&(73)
&&&&&&&&&&&&Flash&&(31)
&&&&&&&&&&&&SD/MMC&&(9)
&&&&&&&&&&&&USB&&(32)
&&&&&&Fieldbus&&(57)
&&&&&&&&&DTM&&(1)
&&&&&&&&&EDDL&&(10)
&&&&&&&&&HART&&(29)
&&&&&&&&&Modbus&&(1)
&&&&&&&&&Profibus&&(6)
&&&&&&&&&PROFINET&&(2)
&&&&&&Industrial Automation&&(59)
&&&&&&Linaro&&(1)
&&&&&&Linux Kernel&&(2)
&&&&&&MCU SoC IP-Core&&(11)
&&&&&&&&&ARM&&(4)
&&&&&&&&&NEC&&(2)
&&&&&&PLC&&(38)
&&&&&&Symbology_Barcode&&(6)
&&&&&&Thread&&(2)
&&&&&&Uboot&&(17)
&&&EncryptDecrypt&&(1)
&&&Hardware&&(13)
&&&&&&Opensource Hardware&&(10)
&&&&&&&&&pcDuino&&(7)
&&&IDE TextEditor&&(87)
&&&&&&Apatana Studio 3&&(2)
&&&&&&ATOM&&(4)
&&&&&&Eclipse&&(37)
&&&&&&Notepad++&&(5)
&&&&&&SciTE&&(1)
&&&&&&Source Insight&&(7)
&&&&&&Sublime Text&&(6)
&&&&&&Visual Studio&&(4)
&&&&&&Xcode&&(20)
&&&&&&&&&Instruments&&(1)
&&&&&&&&&iOS Simulator&&(1)
&&&Network&&(7)
&&&&&&SIP&&(1)
&&&&&&Wireshark&&(3)
&&&OS_Platform&&(581)
&&&&&&CentOS&&(4)
&&&&&&Linux&&(146)
&&&&&&&&&diff&&(4)
&&&&&&&&&Driver&&(36)
&&&&&&&&&gcc&&(1)
&&&&&&&&&makefile&&(13)
&&&&&&&&&NFS&&(2)
&&&&&&&&&patch&&(3)
&&&&&&&&&Wireless&&(7)
&&&&&&Mac&&(34)
&&&&&&&&&Cocoa&&(1)
&&&&&&&&&iphone&&(1)
&&&&&&MobilePlatform&&(350)
&&&&&&&&&Android&&(266)
&&&&&&&&&&&&Android Studio&&(14)
&&&&&&&&&&&&Osmand&&(5)
&&&&&&&&&iOS&&(84)
&&&&&&&&&&&&Swift&&(34)
&&&&&&Ubuntu&&(38)
&&&&&&Windows&&(9)
&&&pneumatic&&(1)
&&&ProgrammingLanguage&&(737)
&&&&&&C&&(48)
&&&&&&C#&&(161)
&&&&&&GO&&(47)
&&&&&&Java&&(48)
&&&&&&&&&JSP&&(1)
&&&&&&&&&Openfire&&(10)
&&&&&&&&&Spark&&(1)
&&&&&&Object-C&&(4)
&&&&&&Perl&&(4)
&&&&&&PHP&&(151)
&&&&&&&&&Drupal&&(16)
&&&&&&&&&Joomla&&(4)
&&&&&&&&&MediaWiki&&(4)
&&&&&&&&&WordPress&&(90)
&&&&&&Python&&(253)
&&&&&&&&&BeautifulSoup&&(11)
&&&&&&&&&Django&&(7)
&&&&&&&&&Python GUI&&(3)
&&&&&&&&&Python IDE&&(14)
&&&&&&&&&Python3&&(8)
&&&&&&&&&StringEncoding&&(16)
&&&&&&R&&(5)
&&&&&&VB.Net&&(5)
&&&&&&VBA&&(11)
&&&RegularExpression&&(54)
&&&&&&Android regex&&(3)
&&&&&&C# Regex&&(1)
&&&&&&dreamweaver regex&&(1)
&&&&&&EditPlus TR1&&(1)
&&&&&&Java regex&&(6)
&&&&&&Notepad++ regex&&(1)
&&&&&&Perl //&&(1)
&&&&&&PHP preg_match&&(1)
&&&&&&Python re&&(30)
&&&&&&UltraEdit 3 type regex&&(1)
&&&&&&VB.NET Regex&&(1)
&&&Soft Dev Basics&&(19)
&&&TechMaterialDownload&&(27)
&&&technical_fun&&(2)
&&&TechnicalLife&&(20)
&&&tmp_todo&&(103)
&&&Virtual Machine&&(78)
&&&&&&VirtualBox&&(42)
&&&&&&VMWare&&(29)
&&&Web_Technology&&(342)
&&&&&&BBS&&(8)
&&&&&&Crawl_EmulateLogin&&(75)
&&&&&&&&&Amazon&&(29)
&&&&&&&&&eBay&&(9)
&&&&&&&&&Scrapy&&(6)
&&&&&&&&&Taobao&&(1)
&&&&&&CSS&&(6)
&&&&&&Google&&(32)
&&&&&&&&&Google Adsense&&(28)
&&&&&&HTML&&(5)
&&&&&&JavaScript&&(24)
&&&&&&&&&easyUI&&(2)
&&&&&&&&&KindEditor&&(3)
&&&&&&&&&Node.js&&(10)
&&&&&&JSON&&(22)
&&&&&&MySQL&&(3)
&&&&&&Skydrive&&(5)
&&&&&&swf flash&&(1)
&&&&&&Tencent&&(1)
&&&&&&UML&&(2)
&&&&&&VirtualHost&&(68)
&&&&&&&&&cPanel&&(3)
&&&&&&&&&hawk&&(11)
&&&&&&&&&sugarhosts&&(7)
&&&&&&&&&TransferWebHosting&&(16)
&&&&&&WebServer&&(5)
&&&&&&&&&apache&&(4)
&&&&&&&&&nginx&&(1)
&&&&&&WeiXin&&(5)
&&&&&&WLW&&(24)
&&&&&&XML&&(3)
&&&&&&&&&XPath&&(2)
&&&wiki&&(2)
&&&经验和教训&&(9)
无法写入&&(1)
有意义&&(637)
&&&值得看的东东&&(138)
&&&新闻与社会&&(196)
&&&日本&&(13)
&&&看图不说话&&(113)
&&&罗永浩[老罗]&&(18)
有趣&&(850)
&&&多收了三五斗&&(21)
&&&开心西游记&&(43)
&&&笑话幽默&&(106)
&&&脑筋急转弯&&(19)
&&&视频&&(22)
&&&超强男女经典征婚启事&&(9)
生活&&(1,430)
&&&Tmp&&(9)
&&&个人推荐&&(84)
&&&信息记录&&(4)
&&&历史&&(3)
&&&安徽&&(12)
&&&心情与思考&&(65)
&&&文学&&(13)
&&&旅游&&(23)
&&&楼市与住房&&(308)
&&&&&&日常生活&&(3)
&&&&&&海德公园&&(39)
&&&&&&装修&&(223)
&&&&&&&&&卫浴&&(1)
&&&&&&&&&吊顶&&(1)
&&&&&&&&&地暖&&(50)
&&&&&&&&&地板&&(2)
&&&&&&&&&家电商场&&(1)
&&&&&&&&&封阳台&&(1)
&&&&&&&&&建材市场&&(9)
&&&&&&&&&整体橱柜&&(8)
&&&&&&&&&瓷砖&&(6)
&&&&&&&&&&&&木纹砖&&(3)
&&&&&&&&&空调&&(1)
&&&&&&&&&衣柜&&(1)
&&&&&&&&&装修日记&&(117)
&&&&&&&&&门&&(2)
&&&淮安&&(3)
&&&游戏&&(14)
&&&电影&&(1)
&&&电脑+数码+软件&&(595)
&&&&&&数码电玩&&(162)
&&&&&&&&&I9100G&&(71)
&&&&&&&&&U盘量产&&(3)
&&&&&&&&&华为手机&&(21)
&&&&&&&&&安卓手机&&(2)
&&&&&&&&&老人机&&(1)
&&&&&&电信&&(2)
&&&&&&电脑_生活&&(9)
&&&&&&电脑知识&&(80)
&&&&&&笔记类软件&&(4)
&&&&&&&&&为知笔记&&(1)
&&&&&&&&&印象笔记&&(2)
&&&&&&系统使用&&(111)
&&&&&&&&&Mac系统&&(34)
&&&&&&&&&Windows系统&&(77)
&&&&&&&&&&&&win10&&(5)
&&&&&&网上银行&&(27)
&&&&&&&&&PayPal&&(1)
&&&&&&&&&中行BOC&&(13)
&&&&&&&&&华夏hxb&&(1)
&&&&&&&&&工行ICBC&&(5)
&&&&&&&&&招行&&(1)
&&&&&&&&&支付宝&&(3)
&&&&&&路由器&&(7)
&&&&&&软件使用&&(168)
&&&&&&&&&360&&(2)
&&&&&&&&&chrome&&(3)
&&&&&&&&&Excel&&(8)
&&&&&&&&&Firefox&&(17)
&&&&&&&&&Flash Player&&(2)
&&&&&&&&&google&&(6)
&&&&&&&&&&&&goagent&&(4)
&&&&&&&&&IE&&(1)
&&&&&&&&&Office&&(3)
&&&&&&&&&Outlook&&(5)
&&&&&&&&&PDF&&(2)
&&&&&&&&&PicPick&&(1)
&&&&&&&&&PowerPoint&&(1)
&&&&&&&&&QQ&&(14)
&&&&&&&&&shadowsocks&&(3)
&&&&&&&&&Thunderbird&&(14)
&&&&&&&&&Word&&(13)
&&&&&&&&&网易163&&(2)
&&&&&&&&&翻墙&&(9)
&&&经济&&(15)
&&&网上购物&&(17)
&&&美食&&(8)
&&&羽毛球&&(22)
&&&苏州&&(57)
&&&&&&工业园区&&(2)
&&&&&&&&&独墅湖高教区&&(2)
知道&&(180)
&&&English&&(60)
&&&生活百科&&(23)
&&&网络资源下载&&(45)
移动硬盘&&(1)
笔记本相关&&(533)
&&&买本前必看&&(33)
&&&无线和迅驰及其相关&&(10)
&&&电脑知识扫盲&&(12)
&&&神舟资料整理&&(342)
&&&&&&别人对神舟的无端诋毁&&(7)
&&&&&&某些笔记本价钱贵但毛病也不少&&(24)
&&&&&&神舟本网站评测&&(7)
&&&&&&神舟电脑评测&&(151)
&&&&&&神舟相关&&(103)
&&&&&&神舟笔记本好的方面的例子&&(17)
&&&&&&给不熟悉的人的解答&&(26)
&&&笔记本cpu&&(26)
&&&笔记本显卡&&(36)
&&&笔记本显卡游戏效果&&(27)
&&&走出笔记本使用误区&&(6)
&&&走出笔记本购买的误区&&(14)
&&&降频功耗散热&&(11)
音乐天堂&&(526)
&&&歌曲类型&&(437)
&&&&&&Hiphop_R&B_Rock&&(23)
&&&&&&中文歌曲&&(160)
&&&&&&外文歌曲&&(200)
&&&&&&纯音乐&无歌词&&(54)
&&&特定歌手&&(38)
&&&&&&Enigma&&(11)
&&&&&&Linkinpark&&(14)
&&&&&&陈琳&&(13)
&&&音乐下载&&(1)
&&&音乐知识&&(9)
默认分类&&(212)
&&&默认分类&&(3)
2015年十二月
78910111213
14151617181920
21222324252627
免费的格式化Javascript源码的网站
查询Unicode字符,且还带Oct,Decimal,Hex,HTML Entity
HTML和Javascript都支持,很好用。}

我要回帖

更多关于 steam fatal error 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信