Two absolutely identical projects - one with link error - one not

  • Thread starter Thread starter Lino_L
  • Start date Start date
L

Lino_L

Guest
After cleaning Win10 and new VS2017 setup I did a test with a very simple former project. Loading it I was asked to update to SDK 10.0.17763 and Toolset V 141, so I did. With this new environment VS compiles and links with no errors & warnings. Then I set up e x a c t l y the same project from scatch by creating it as new entering the code manually and adjusted this entries:

Linker|System|Subsystem: Windows (/SUBSYSTEM:WINDOWS)

Linker|Advanced|EntryPoint: "xyzmain"

This brought up the "LINK1561 entry point must be defined" error. To check for the reason I compared A L L entries of the solution properties and A L L files in the project directories of both solutions - but found no differences unless some incidental UIDs.

Here is how to reproduce:

1 - Create a Visual C++ CLR Empty Project (x64 or x86 Platform)

2 - Add a C++ UI Windows Form item

3 - Add this code to 'MyForm' as an example

using namespace System;
using namespace System::Windows::Forms;
void xyzmain(array<String^>^ args) /* Entry point */
{
int cnt;
for (cnt=args->GetLowerBound(0); cnt<=args->GetUpperBound(0); cnt++);
if (!cnt)
{MessageBox::Show("UserInterface Mode","Mode");}
}

4 - delete Myform.h file (as there is no form needed)

5 - set Linker|System|Subsystem to "Windows (/SUBSYSTEM:WINDOWS)" and Linker|Advanced|EntryPoint to "xyzmain" (or main or sth. else in accordance )

6 - and debug ...

How can that LINK error be handled?

Continue reading...
 
Back
Top