Discussion:
Build JCC - Unresolved Symbol Error
sarthak jain
2016-01-13 19:12:26 UTC
Permalink
Hi, I am trying to build JCC ver 2.20 on Windows 10, using Python 2.7, MSVS
C++ 2008 compiler. I am receiving following error message while installing :

Loading source files for package org.apache.jcc...
Constructing Javadoc information...
Standard Doclet version 1.8.0_65
Building tree for all the packages and classes...
Generating javadoc\org\apache\jcc\PythonException.html...
Generating javadoc\org\apache\jcc\PythonVM.html...
Generating javadoc\org\apache\jcc\package-frame.html...
Generating javadoc\org\apache\jcc\package-summary.html...
Generating javadoc\org\apache\jcc\package-tree.html...
Generating javadoc\constant-values.html...
Generating javadoc\serialized-form.html...
Building index for all the packages and classes...
Generating javadoc\overview-tree.html...
Generating javadoc\index-all.html...
Generating javadoc\deprecated-list.html...
Building index for all classes...
Generating javadoc\allclasses-frame.html...
Generating javadoc\allclasses-noframe.html...
Generating javadoc\index.html...
Generating javadoc\help-doc.html...
running build
running build_py
writing F:\pylucene\jcc\jcc\config.py
copying jcc\config.py -> build\lib.win32-2.7\jcc
copying jcc\jcc.lib -> build\lib.win32-2.7\jcc
copying jcc\classes\org\apache\jcc\PythonVM.class ->
build\lib.win32-2.7\jcc\classes\org\apache\jcc
copying jcc\classes\org\apache\jcc\PythonException.class ->
build\lib.win32-2.7\jcc\classes\org\apache\jcc
running build_ext
building 'jcc' extension
C:\Users\SARTHAKJAIN\AppData\Local\Programs\Common\Microsoft\Visual C++ for
Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D_jcc_lib
-DJCC_VER="2.20" "-Ic:/Program Files/Java/jdk1.8.0_65/include"
"-Ic:/Program Files/Java/jdk1.8.0_65/include/win32" -I_jcc -Ijcc/sources
-IC:\Python27\include -IC:\Python27\PC /Tpjcc/sources/jcc.cpp
/Fobuild\temp.win32-2.7\Release\jcc/sources/jcc.obj -DPYTHON /EHsc
/D_CRT_SECURE_NO_WARNINGS
jcc.cpp
f:\pylucene\jcc\jcc\sources\JCCEnv.h(118) : warning C4251: 'JCCEnv::refs' :
class 'std::multimap<_Kty,_Ty>' needs to have dll-interface to be used by
clients of class 'JCCEnv'
with
[
_Kty=int,
_Ty=countedRef
]
C:\Users\SARTHAKJAIN\AppData\Local\Programs\Common\Microsoft\Visual C++ for
Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D_jcc_lib
-DJCC_VER="2.20" "-Ic:/Program Files/Java/jdk1.8.0_65/include"
"-Ic:/Program Files/Java/jdk1.8.0_65/include/win32" -I_jcc -Ijcc/sources
-IC:\Python27\include -IC:\Python27\PC /Tpjcc/sources/JCCEnv.cpp
/Fobuild\temp.win32-2.7\Release\jcc/sources/JCCEnv.obj -DPYTHON /EHsc
/D_CRT_SECURE_NO_WARNINGS
JCCEnv.cpp
f:\pylucene\jcc\jcc\sources\JCCEnv.h(118) : warning C4251: 'JCCEnv::refs' :
class 'std::multimap<_Kty,_Ty>' needs to have dll-interface to be used by
clients of class 'JCCEnv'
with
[
_Kty=int,
_Ty=countedRef
]
C:\Users\SARTHAKJAIN\AppData\Local\Programs\Common\Microsoft\Visual C++ for
Python\9.0\VC\Bin\link.exe /DLL /nologo /INCREMENTAL:NO
/LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild
build\temp.win32-2.7\Release\jcc/sources/jcc.obj
build\temp.win32-2.7\Release\jcc/sources/JCCEnv.obj
/OUT:build\lib.win32-2.7\jcc.dll
/IMPLIB:build\temp.win32-2.7\Release\jcc/sources\jcc.lib
/MANIFESTFILE:build\temp.win32-2.7\Release\jcc/sources\jcc.dll.manifest
"/LIBPATH:c:/Program Files/Java/jdk1.8.0_65/lib" Ws2_32.lib jvm.lib
/IMPLIB:jcc\jcc.lib
Creating library jcc\jcc.lib and object jcc\jcc.exp
jcc.obj : error LNK2019: unresolved external symbol
***@12 referenced in function "struct _object * __cdecl
initVM(struct _object *,struct _object *,struct _object *)" (?initVM@
@YAPAU_object@@***@00@Z)
jcc.obj : error LNK2019: unresolved external symbol
***@4 referenced in function "struct
_object * __cdecl initVM(struct _object *,struct _object *,struct _object
*)" (?initVM@@YAPAU_object@@***@00@Z)
build\lib.win32-2.7\jcc.dll : fatal error LNK1120: 2 unresolved externals
error: command
'"C:\Users\SARTHAKJAIN\AppData\Local\Programs\Common\Microsoft\Visual C++
for Python\9.0\VC\Bin\link.exe"' failed with exit status 1120

Sarthak Jain
Andi Vajda
2016-01-13 19:54:15 UTC
Permalink
Post by sarthak jain
Hi, I am trying to build JCC ver 2.20 on Windows 10, using Python 2.7, MSVS
Two things come to mind:
- try a more recent compiler, ideally the same version used to build your python installation
- make sure the version of the JNI headers you're
including correspond to the version of the java lib you're linking against.

Andi..
Post by sarthak jain
Loading source files for package org.apache.jcc...
Constructing Javadoc information...
Standard Doclet version 1.8.0_65
Building tree for all the packages and classes...
Generating javadoc\org\apache\jcc\PythonException.html...
Generating javadoc\org\apache\jcc\PythonVM.html...
Generating javadoc\org\apache\jcc\package-frame.html...
Generating javadoc\org\apache\jcc\package-summary.html...
Generating javadoc\org\apache\jcc\package-tree.html...
Generating javadoc\constant-values.html...
Generating javadoc\serialized-form.html...
Building index for all the packages and classes...
Generating javadoc\overview-tree.html...
Generating javadoc\index-all.html...
Generating javadoc\deprecated-list.html...
Building index for all classes...
Generating javadoc\allclasses-frame.html...
Generating javadoc\allclasses-noframe.html...
Generating javadoc\index.html...
Generating javadoc\help-doc.html...
running build
running build_py
writing F:\pylucene\jcc\jcc\config.py
copying jcc\config.py -> build\lib.win32-2.7\jcc
copying jcc\jcc.lib -> build\lib.win32-2.7\jcc
copying jcc\classes\org\apache\jcc\PythonVM.class ->
build\lib.win32-2.7\jcc\classes\org\apache\jcc
copying jcc\classes\org\apache\jcc\PythonException.class ->
build\lib.win32-2.7\jcc\classes\org\apache\jcc
running build_ext
building 'jcc' extension
C:\Users\SARTHAKJAIN\AppData\Local\Programs\Common\Microsoft\Visual C++ for
Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D_jcc_lib
-DJCC_VER="2.20" "-Ic:/Program Files/Java/jdk1.8.0_65/include"
"-Ic:/Program Files/Java/jdk1.8.0_65/include/win32" -I_jcc -Ijcc/sources
-IC:\Python27\include -IC:\Python27\PC /Tpjcc/sources/jcc.cpp
/Fobuild\temp.win32-2.7\Release\jcc/sources/jcc.obj -DPYTHON /EHsc
/D_CRT_SECURE_NO_WARNINGS
jcc.cpp
class 'std::multimap<_Kty,_Ty>' needs to have dll-interface to be used by
clients of class 'JCCEnv'
with
[
_Kty=int,
_Ty=countedRef
]
C:\Users\SARTHAKJAIN\AppData\Local\Programs\Common\Microsoft\Visual C++ for
Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D_jcc_lib
-DJCC_VER="2.20" "-Ic:/Program Files/Java/jdk1.8.0_65/include"
"-Ic:/Program Files/Java/jdk1.8.0_65/include/win32" -I_jcc -Ijcc/sources
-IC:\Python27\include -IC:\Python27\PC /Tpjcc/sources/JCCEnv.cpp
/Fobuild\temp.win32-2.7\Release\jcc/sources/JCCEnv.obj -DPYTHON /EHsc
/D_CRT_SECURE_NO_WARNINGS
JCCEnv.cpp
class 'std::multimap<_Kty,_Ty>' needs to have dll-interface to be used by
clients of class 'JCCEnv'
with
[
_Kty=int,
_Ty=countedRef
]
C:\Users\SARTHAKJAIN\AppData\Local\Programs\Common\Microsoft\Visual C++ for
Python\9.0\VC\Bin\link.exe /DLL /nologo /INCREMENTAL:NO
/LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild
build\temp.win32-2.7\Release\jcc/sources/jcc.obj
build\temp.win32-2.7\Release\jcc/sources/JCCEnv.obj
/OUT:build\lib.win32-2.7\jcc.dll
/IMPLIB:build\temp.win32-2.7\Release\jcc/sources\jcc.lib
/MANIFESTFILE:build\temp.win32-2.7\Release\jcc/sources\jcc.dll.manifest
"/LIBPATH:c:/Program Files/Java/jdk1.8.0_65/lib" Ws2_32.lib jvm.lib
/IMPLIB:jcc\jcc.lib
Creating library jcc\jcc.lib and object jcc\jcc.exp
jcc.obj : error LNK2019: unresolved external symbol
@YAPAU_object@@***@00@Z)
jcc.obj : error LNK2019: unresolved external symbol
_object * __cdecl initVM(struct _object *,struct _object *,struct _object
build\lib.win32-2.7\jcc.dll : fatal error LNK1120: 2 unresolved externals
error: command
'"C:\Users\SARTHAKJAIN\AppData\Local\Programs\Common\Microsoft\Visual C++
for Python\9.0\VC\Bin\link.exe"' failed with exit status 1120
Sarthak Jain
Loading...