MS VC++ .NET (2002) - Fatal Error LNK1561:entry point must be defined

S

Scott Chang

Hi all,
I have Microsoft Visual C++ .NET (2002) program that is
installed on my Windows XP Professional Operating System
PC. I started my project (named HelloMCPP)in the Managed
C++ Application and added a DLL in the .h file to my
project for printing "Hello from Managed C++!" out in my
console. I did "Build" the program 'HelloMCPP' and I
got 'Fatal Error LNK1561: entry point must be defined
HelloMCPP'. I do not know how to define the entry point
in this project. Please help and advise how to define it
and get this project executed.
Thanks in advanve,
Scott Chang
******************
The following is the souce code of my HelloMCPP:
-------------------------------------
AssemblyInfo.cpp
---------------------
#include "stdafx.h"
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
//
// General Information about an assembly is controlled
through the following
// set of attributes. Change these attribute values to
modify the information
// associated with an assembly.
//
[assembly:AssemblyTitleAttribute("")];
[assembly:AssemblyDescriptionAttribute("")];
[assembly:AssemblyConfigurationAttribute("")];
[assembly:AssemblyCompanyAttribute("")];
[assembly:AssemblyProductAttribute("")];
[assembly:AssemblyCopyrightAttribute("")];
[assembly:AssemblyTrademarkAttribute("")];
[assembly:AssemblyCultureAttribute("")];
//
// Version information for an assembly consists of the
following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the value or you can default the
Revision and Build Numbers
// by using the '*' as shown below:
[assembly:AssemblyVersionAttribute("1.0.*")];
//
// In order to sign your assembly you must specify a key
to use. Refer to the
// Microsoft .NET Framework documentation for more
information on assembly signing.
//
// Use the attributes below to control which key is used
for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not
signed.
// (*) KeyName refers to a key that has been installed
in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers
to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both
specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that
key is used.
// (2) If the KeyName does not exist and the
KeyFile does exist, the key
// in the KeyFile is installed into the CSP and
used.
// (*) In order to create a KeyFile, you can use the
sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of
the KeyFile should be
// relative to the project directory.
// (*) Delay Signing is an advanced option - see the
Microsoft .NET Framework
// documentation for more information on this.
//
[assembly:AssemblyDelaySignAttribute(false)];
[assembly:AssemblyKeyFileAttribute("")];
[assembly:AssemblyKeyNameAttribute("")];
--------------------------------
HelloMCPP.cpp
--------------------
// This is the main DLL file.
#include "stdafx.h"
#include "HelloMCPP.h"
----------------------
Stdafx.cpp
-------------------
// stdafx.cpp : source file that includes just the
standard includes
// HelloMCPP.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type
information
#include "stdafx.h"
----------------------
HelloMCPP.h
-----------------
// HelloMCPP.h

#pragma once

using namespace System;

namespace HelloMCPP
{
public __gc class HelloMCPP
{
public:
virtual void Hello()
{
Console::WriteLine(S"Hello from Managed C++!");
}
};
}
--------------------------------------
stdafx.h
-------------------------------
// stdafx.h : include file for standard system include
files,
// or project specific include files that are used
frequently,
// but are changed infrequently

#pragma once

#using <mscorlib.dll>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top