- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a project which has been working fine under x64, now I have a requirement to get it working under Win32. I have created a new platform Win32 in the sln and vfproj files. However I keep getting this link error:
dflc.obj : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'
if I exclude dflc.f90 from the project, it gives me the same error but with another file and stops. And so on. So it's not a problem with the file itself.
However for some reason it is thinking the target machine type is 'x64' whereas I have specified Debug / Win32 as my build configuration.
It is getting x64 from somewhere, but I have no idea where.
MS Visual Studio 2022 17.4.4 / Intel Fortran Version 2021.8.0 Build 20221119_000000
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried "clean" and building again?
Normally, Visual studio keeps 32-bit and 64-bit objects in different directories, but the user may override the default locations.
You can find if a given OBJ file is a 32-bit or a 64-bit object in a number of ways. One way is to use the command
dumpbin /headers xyz.obj | findstr /i machine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, closed VS, relaunch, clean, rebuild. The Win32 and x64 directories are all separate. The obj file is x86, I did a dumpbin. The problem is that the link thinks it is targeting a x64 config, which is incorrect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the problem.
Properties -> Linker -> Advanced -> Target Machine
It was "Not Set"
I changed to MachineX86.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page