Unable to build a project due to warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'

Kamlesh Mishra 6 Reputation points
2022-01-21T10:52:44.857+00:00

We have a project that has been build for x86 . It builds in VS2019 also
On VS2022 , it throws error as below

\sys_nt\VS2019\Program_Files_x86\Microsoft_Visual_Studio\2019\Professional\VSSDK\VisualStudioIntegration\Common\Lib\x64\vsguids.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
\sys_nt\VS2019\Program_Files_x86\Microsoft_Visual_Studio\2019\Professional\VSSDK\VisualStudioIntegration\Common\Lib\x64\vseeguids.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'

  1. we tried with the change of machine at

linker --> all options-->target machine = MACHINE:X64

Developer technologies | C++
{count} votes

1 answer

Sort by: Most helpful
  1. Heba emad 0 Reputation points
    2023-12-22T22:36:16.58+00:00

    I had that same issue while i was trying to add a new .lib , .h and .dll files

    I'm not an expert , I'm just a student, here's how i solved it after hours of trying :

    when you place your library file , pick either x64 or x86 , DON'T DO BOTH

    then before running your code there's a category beside the debugging green arow it's called solution platform

    ( it says x64 for me) match it with the library file you chose . and run your code .

    it worked for me at x86, I'll try to understand the science behind it one day lol, i hope it works for you as well ;)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.