Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29273 Discussions

LNK1221: a subsystem can't be inferred and must be defined

tsmithapp-geo-resear
2,049 Views

Using IVF 11.1. I have a simple dll with 3 subroutines. If I build with Debugon Configuration x86 (Win32) It builds and
runs just fine. When I switch to Debug x64 I get > "LINK : fatal error LNK1221: a subsystem can't be inferred and must be defined". I installed $(IFORT_COMPILER11)lib\ia64 as per instructions so I expected to build x64.
The DLL has no dependencies. I do have different target folders for the Win32 and x64 dll's.
IF I switch to x64 "Release" I get a different error: " error LNK2019: unresolved external symbol MAIN__ referenced in function main". But there is no function "main". There are only 3 subroutines in this little utility.
What couldI be missing?

0 Kudos
3 Replies
tsmithapp-geo-resear
2,049 Views

You only need to reinstall if you did not install the Intel 64 compiler. It sounds as if you did, though. Correcting the entry will allow C++ to link with the correct Fortran run-time libraries.

Please attach the .vfproj and .vcproj files of the projects you use to build this DLL, as well as the buildlog.htm file.

Ok I've attached the vfproj, and the buildlog.htm for both the Debug and for the Release because they log different error messages. I didnt attach the vcproj because this error happens independent of any program which calls this dll. Just building the fortran 64 version of the project can cause this. But if needed, of course I'll send but doesnt seem necessary at the moment. Also The 32b version works fine.
0 Kudos
Steven_L_Intel1
Employee
2,049 Views
Your project file was quite messed up. It had the linker "subsystem" set as Console or Windows for three of the four configurations, and had an entry point set for one of them. It also seemed to lack the option to link a DLL for some of the configurations. I have corrected this and attached the corrected project. Try this.
0 Kudos
tsmithapp-geo-resear
2,049 Views
Your project file was quite messed up. It had the linker "subsystem" set as Console or Windows for three of the four configurations, and had an entry point set for one of them. It also seemed to lack the option to link a DLL for some of the configurations. I have corrected this and attached the corrected project. Try this.

That was it! Thanks for getting me back on track.
0 Kudos
Reply