OPENCV 3.x - Visual Studio 2015 14.0.25424 Update 3 zlib X64 fail

asked 2016-08-14 16:46:22 -0600

Airhead gravatar image

I finally got the x86 (Win32) build to complete without errors: Install VS 2015, test with HelloWorld on Win32 and X64, Install git, Cmake, Git opencv to D:\opencv_get\opencv, configure VS paths and includes, build x86 debug, release and install, no errors. Use Configuration Manager to change the projects target to X64, clean and build, 59 errors: Error LNK1112 module machine type 'x64' conflicts with target machine type 'X86' zlib D:\opencv_git\opencv\mybuild\3rdparty\zlib\x64\Debug\adler32.obj 1 NOTE there is 6 c source files and only this one fails or it is the first....

Close Project and Open only zilb Everything says I'm building X64 but the obj file must be Win32. Other files that failed without the 32 in their name do the same thing, fail.

After several hours of shear enjoyment: Click on your project - zlib, tight click to properties, on the zlib Property Pages: Configuration Properties / Librarian / All Options / Additional Library Directories I found /machine:X86 %(AdditionalOptions) for a X64 build /machine:X64 %(AdditionalOptions)

So after 18 years Microsft still can't figure out how to build a tool, when I told VS to build X64 at the project level I meant change all so my project would compile without me having to look/touch every setting.

edit retag flag offensive close merge delete

Comments

"Use Configuration Manager to change the projecchange project type therets target to X64," -- this might be the wrong way to do so. rather re-run cmake, and change project type there

berak gravatar imageberak ( 2016-08-14 20:11:17 -0600 )edit

I tried both, no luck, I used the Configuration Manager at the Project level and Source level, I had to walk each setting before I noticed the Directives masked as Additional Library Directories. /machine:X86 %(AdditionalOptions) is not Additional Library Directories. I found things that the only way to know why they are the way they are would be to throw another $3 grand (VS 6) at MSDN: I just looked it up, I qualify for a Lease MSDN + VS Pro ~$16 a month... From CDN so I'll call, if no lease ~$500.

Airhead gravatar imageAirhead ( 2016-08-14 23:29:45 -0600 )edit