Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link error when compiling on Windows #5

Open
iliuhe opened this issue Oct 11, 2017 · 8 comments
Open

Link error when compiling on Windows #5

iliuhe opened this issue Oct 11, 2017 · 8 comments

Comments

@iliuhe
Copy link

iliuhe commented Oct 11, 2017

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!

@KateKwiecinski
Copy link

@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,

@pathak22
Copy link
Owner

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.

@iliuhe
Copy link
Author

iliuhe commented Oct 22, 2017

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

@iliuhe iliuhe closed this as completed Oct 22, 2017
@iliuhe
Copy link
Author

iliuhe commented Oct 22, 2017

@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

@KateKwiecinski
Copy link

@iliuhe Thanks so much for your help!

@stephahn
Copy link

stephahn commented Jan 30, 2018

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")

@pathak22 pathak22 reopened this Feb 17, 2018
@vepkenez
Copy link

vepkenez commented Mar 2, 2018

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

@shreyanse081
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants