I’m trying to port my python 2.7 Panda app to 3.7 while upgrading from Panda 1.9 to 1.10-x64.
Eventually I want to build my installer using deploy-ng.
My first step is to be able to compile Cython modules with the new compiler.
After downloading VC++ 2015, I can now compile and run a Cython hello world.
I try compiling my app, which includes several Cython modules.
It gets through some of them. However, after compiling one of them, it has trouble linking.
The compilation command shown below runs fine, with a few warnings here and there. Note that newlines are added for readability:
running build_ext
skipping 'path\to\module.cpp' Cython extension (up-to-date)
building 'module' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe
/c /nologo /Ox /W3 /GL /DNDEBUG /MT
-IC:\Panda3D-1.10.0-x64\include
-IC:\Panda3D-1.10.0-x64\python\include
-IC:\Panda3D-1.10.0-x64\python\include
"-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE"
"-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt"
"-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt"
/EHsc /Tppath\to\module.cpp /Fobuild\temp.win-amd64-3.7\Release\path\to\module.obj /EHsc -DNDEBUG
module.cpp
...series of warnings.....
The linking command has trouble though:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.exe
/nologo /INCREMENTAL:NO /LTCG /nodefaultlib:libucrt.lib ucrt.lib /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO
/LIBPATH:C:\Panda3D-1.10.0-x64\python\libs
/LIBPATH:C:\Panda3D-1.10.0-x64\lib
/LIBPATH:C:\Panda3D-1.10.0-x64\python\libs
/LIBPATH:C:\Panda3D-1.10.0-x64\python\PCbuild\amd64
"/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64"
"/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64"
"/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64"
"/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64"
"/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64" libpanda.lib
/EXPORT:PyInit_module build\temp.win-amd64-3.7\Release\path\to\module.obj
/OUT:c:\Users\<user>\path\to\pandapp\module.cp37-win_amd64.pyd
/IMPLIB:build\temp.win-amd64-3.7\Release\path\to\module.cp37-win_amd64.lib
module.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) int panda_version_1_10" (__imp_?panda_version_1_10@@3HA)
c:\Users\<user>\path\to\pandapp\module.cp37-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\link.exe' failed with exit status 1120
Any ideas? I’m pretty much stumped here.
I noticed that the folder
C:\Panda3D-1.10.0-x64\python\PCbuild\
does not exist, even after reinstalling.
Perhaps something is wrong with my installation?
I got the build tools for MSVS 2017. With that I installed:
- .NET 4.7 SDK and Targeting Pack.
- C++/CLI Support
- VC++ 2015.3 v14.00 (v140) toolset for desktop
- VC++ 2017 version 15.9 v14.16 latest v141 tools
- Windows 10 SDK 10.0.10240.0
I also installed Visual Studio Community 2017 (2) 15.9.5 along with similar things as above:
- C++/CLI Support
- Windows 10 SDK 10.0.17134.0
- Windows 10 SDK 10.0.17763.0
- Visual C++ 2017 Redistributable Update
- VC++ 2015.3 v14.00 (v140) toolset for Desktop
- VC++ 2017 version 15.9 v14.16 latest v141 tools
However, I’ve been running my app’s build script from the command line.
The PATH variable in my VS2015 x64 Native Tools Command Prompt is:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools
C:\Program Files (x86)\HTML Help Workshop
C:\Program Files (x86)\Windows Kits\10\bin\x64
C:\Program Files (x86)\Windows Kits\10\bin\x86
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\
C:\Program Files (x86)\Intel\iCLS Client\
C:\Program Files\Intel\iCLS Client\
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
C:\Program Files\Intel\WiFi\bin\
C:\Program Files\Common Files\Intel\WirelessCommon\
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\Git\cmd
C:\Program Files\dotnet\
C:\Users\Provel\AppData\Local\Microsoft\WindowsApps
C:\bin
C:\Program Files (x86)\Panda3D\
C:\Panda3D-1.10.0-x64\python
C:\Panda3D-1.10.0-x64\python\Scripts
C:\Panda3D-1.10.0-x64\bin