pyflow icon indicating copy to clipboard operation
pyflow copied to clipboard

Link error when compiling on Windows

Open iliuhe opened this issue 8 years ago • 8 comments

I was trying to compile this on a Windows machine. However I got this error:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:C:\Python27\PC\VS9.0\amd64 /EXPORT:initpyflow build\temp.win-amd64-2.7\Release\pyflow.obj build\temp.win-amd64-2.7\Release\src\Coarse2FineFlowWrapper.obj build\temp.win-amd64-2.7\Release\src\GaussianPyramid.obj build\temp.win-amd64-2.7\Release\src\OpticalFlow.obj build\temp.win-amd64-2.7\Release\src\Stochastic.obj build\temp.win-amd64-2.7\Release\src/Coarse2FineFlowWrapper.obj "/OUT:C:\Users\iliuh\Documents\Python Scripts\pyflow-master\pyflow.pyd" /IMPLIB:build\temp.win-amd64-2.7\Release\pyflow.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\pyflow.pyd.manifest
Coarse2FineFlowWrapper.obj : error LNK2005: "void __cdecl Coarse2FineFlowWrapper(double *,double *,double *,double const *,double const *,double,double,int,int,int,int,int,int,int,int)" (?Coarse2FineFlowWrapper@@YAXPEAN00PEBN1NNHHHHHHHH@Z) already defined in Coarse2FineFlowWrapper.obj
pyflow.obj : warning LNK4197: export 'initpyflow' specified multiple times; using first specification

   Creating library build\temp.win-amd64-2.7\Release\pyflow.lib and object build\temp.win-amd64-2.7\Release\pyflow.exp
C:\Users\iliuh\Documents\Python Scripts\pyflow-master\pyflow.pyd : fatal error LNK1169: one or more multiply defined symbols found
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\amd64\\link.exe' failed with exit status 1169

Any ideas? I also tried this code in the Ubuntu system and it complied successfully. Thanks so much!

iliuhe avatar Oct 11 '17 17:10 iliuhe

@iliuhe @pathak22 I am also getting error while attempting to compiler on windows, but not this one.
'C:\\Users\\kkwiecin\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

I followed instructions exactly, I'm not sure what I'm doing wrong. I don't have access to an Ubuntu system, so I would really love to get this working on Windows 10. Any ideas you guys have would be much appreciated.

Thanks,

KateKwiecinski avatar Oct 20 '17 16:10 KateKwiecinski

Sorry guys, I have never tried running this on windows. I do not have windows machine, so not sure if I could be of help here.

pathak22 avatar Oct 20 '17 22:10 pathak22

@pathak22 I believe I will keep using ubuntu for this project. Thanks for your reply.

iliuhe avatar Oct 22 '17 01:10 iliuhe

@KateKwiecinski Hey, I dont have any better ideas to solve this right now. But I think there is a build-in Ubuntu system for windows 10. Instead of finding another Ubuntu laptop, you can just do your work in windows. Hope it can help

iliuhe avatar Oct 22 '17 01:10 iliuhe

@iliuhe Thanks so much for your help!

KateKwiecinski avatar Oct 23 '17 13:10 KateKwiecinski

I found a solution: The problem is that all the *.cpp files are included in sourcefiles in the setup.py. In the same time, the Coarse2FineFlowWrapper.cpp was included in the .pyx at line 2. I think but not sure that the compiler use the two definitions . I modified the setup file by adding the following line before the definition of the variable "extensions" and it is working for me: sourcefiles.remove("src\\Coarse2FineFlowWrapper.cpp")

stephahn avatar Jan 30 '18 07:01 stephahn

Also, be sure to comment this line: https://github.com/pathak22/pyflow/blob/master/src/project.h#L9

vepkenez avatar Mar 02 '18 00:03 vepkenez

Visit this link for solution. This repo is forked and modified for windows users.

shreyanse081 avatar Feb 26 '19 06:02 shreyanse081