I get a link error when I try and create a module of the following
very simple managed C++ code. I can't imagine a more minimum piece of
code, so I imagine that this is some sort of compiler bug.
#using <mscorlib.dll>
__gc public class Test : public System::Object
{
};
$ cl /clr:noAssembly /LD test.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 13.10.3077 for .NET
Framework
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
test.cpp
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.dll
/noentry
/noassembly
/dll
/implib:test.lib
test.obj
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main
referenced in function _mainCRTStartup
test.dll : fatal error LNK1120: 1 unresolved externals 6 2832
That does not look like a bug. Since you are asking it to create a
executable, it could not find an entry point. If you do the same in C# ..
using System;
public class Test {
}
and compile this, it will complain about "no entry point".
This is just complaining in C++ speak. :)
--
Girish Bharadwaj
"Peter Ross" <pr*@missioncriticalit.com> wrote in message
news:88**************************@posting.google.c om... I get a link error when I try and create a module of the following very simple managed C++ code. I can't imagine a more minimum piece of code, so I imagine that this is some sort of compiler bug.
#using <mscorlib.dll> __gc public class Test : public System::Object { };
$ cl /clr:noAssembly /LD test.cpp Microsoft (R) C/C++ Optimizing Compiler Version 13.10.3077 for .NET Framework Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
test.cpp Microsoft (R) Incremental Linker Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.dll /noentry /noassembly /dll /implib:test.lib test.obj LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup test.dll : fatal error LNK1120: 1 unresolved externals
Doh! I did not read the complete message. :) It does not seem to make sense
since you are passing /noentry.. why is it complaining..
sorry. ignore my last post.
--
Girish Bharadwaj
"Girish Bharadwaj" <girishb.at.mvps.dot.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... That does not look like a bug. Since you are asking it to create a executable, it could not find an entry point. If you do the same in C# .. using System; public class Test { }
and compile this, it will complain about "no entry point".
This is just complaining in C++ speak. :)
-- Girish Bharadwaj "Peter Ross" <pr*@missioncriticalit.com> wrote in message news:88**************************@posting.google.c om... I get a link error when I try and create a module of the following very simple managed C++ code. I can't imagine a more minimum piece of code, so I imagine that this is some sort of compiler bug.
#using <mscorlib.dll> __gc public class Test : public System::Object { };
$ cl /clr:noAssembly /LD test.cpp Microsoft (R) C/C++ Optimizing Compiler Version 13.10.3077 for .NET Framework Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
test.cpp Microsoft (R) Incremental Linker Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.dll /noentry /noassembly /dll /implib:test.lib test.obj LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup test.dll : fatal error LNK1120: 1 unresolved externals
BTW: the same code compiles just fine on a .NET 1.0.
cl /clr:noAssembly /LD empty.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 13.00.9466 for .NET
Framework
Copyright (C) Microsoft Corporation 1984-2001. All rights reserved.
empty.cpp
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.
/out:empty.dll
/noentry
/noassembly
/dll
/implib:empty.lib
empty.obj
I guess you are right. This probably is something funky with the .NET 1.1 ..
--
Girish Bharadwaj
"Girish Bharadwaj" <girishb.at.mvps.dot.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... That does not look like a bug. Since you are asking it to create a executable, it could not find an entry point. If you do the same in C# .. using System; public class Test { }
and compile this, it will complain about "no entry point".
This is just complaining in C++ speak. :)
-- Girish Bharadwaj "Peter Ross" <pr*@missioncriticalit.com> wrote in message news:88**************************@posting.google.c om... I get a link error when I try and create a module of the following very simple managed C++ code. I can't imagine a more minimum piece of code, so I imagine that this is some sort of compiler bug.
#using <mscorlib.dll> __gc public class Test : public System::Object { };
$ cl /clr:noAssembly /LD test.cpp Microsoft (R) C/C++ Optimizing Compiler Version 13.10.3077 for .NET Framework Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
test.cpp Microsoft (R) Incremental Linker Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.dll /noentry /noassembly /dll /implib:test.lib test.obj LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup test.dll : fatal error LNK1120: 1 unresolved externals
Hi Peter, I get a link error when I try and create a module of the following very simple managed C++ code. I can't imagine a more minimum piece of code, so I imagine that this is some sort of compiler bug.
#using <mscorlib.dll> __gc public class Test : public System::Object { };
Not at all. You're running against the changes made to the compiler/linker
to minimize the Loader-Lock problem (a module is esentially a dll, and will
be subject to the same problems).
To get around it, just link with nochkclr.obj:
cl /clr:noAssembly /LD test.cpp nockclr.obj
--
Tomas Restrepo to****@mvps.org
"Tomas Restrepo \(MVP\)" <to****@mvps.org> wrote in message news:<#U**************@tk2msftngp13.phx.gbl>... Hi Peter,
I get a link error when I try and create a module of the following very simple managed C++ code. I can't imagine a more minimum piece of code, so I imagine that this is some sort of compiler bug.
#using <mscorlib.dll> __gc public class Test : public System::Object { };
Not at all. You're running against the changes made to the compiler/linker to minimize the Loader-Lock problem (a module is esentially a dll, and will be subject to the same problems).
To get around it, just link with nochkclr.obj: cl /clr:noAssembly /LD test.cpp nockclr.obj
Thank you Tomas that did solve the problem.
I had seen some KB articles about the Loader-Lock problem, but
couldn't relate it directly to my problem.
Could you point me to a resource which mentions nochkclr.obj? I am
interested to see why I didn't work it out.
Regards,
Peter
Hi Peter, Thank you Tomas that did solve the problem.
I had seen some KB articles about the Loader-Lock problem, but couldn't relate it directly to my problem.
It was a logical conclusion for me, since modules are usually linked into an
assembly, typically a DLL one (and not an EXE).
Could you point me to a resource which mentions nochkclr.obj? I am interested to see why I didn't work it out.
Humm... let me see... I believe the documentation mentions it... See [1] and
[2]
[1] http://msdn.microsoft.com/library/de...rorlnk2019.asp
[2] http://msdn.microsoft.com/library/en...omixedmode.asp
--
Tomas Restrepo to****@mvps.org This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Eric |
last post by:
It seems like this is the second time I have come across this with a Pythonmodule, and I'd like to get some perspective on it.
I tried to build PyPerl (on my Win XP machine) and got the following:...
|
by: Jeff Hagelberg |
last post by:
I'm trying to create a python module which can be used by a python
interpreter embedded inside a fortran program I have. To do this, I
first created python wrappers for all the functions in my...
|
by: David Lack |
last post by:
Hi,
I recently installed a 60-day trial of .NET 2003 on my development system.
I made tests with previous personal projects (which compiled ok with VC6)
and some open source files, and keep...
|
by: Jonathan Wilson |
last post by:
Is it possible to use vcbuild with the free MS compiler toolkit, as in can
someone with just the MS toolkit and no access to a copy of Visual Studio
itself use vcbuild to compile a Visual Studio...
|
by: Ganapathy |
last post by:
I have COM dll code written in VC 6.0. When i tried
compiling this code in VC 7, The MIDL cmpiler gets called
twice. i.e. it initially compiles fully & immediately a
line - 64 bit processing'...
|
by: Marek Krzeminski |
last post by:
I followed the instructions in the following link
(http://support.microsoft.com/kb/325093/EN-US/) to fix my ASP server and it
now works
HOWEVER, when I try to use Visual Studio to compile any...
|
by: skip |
last post by:
Here's a trivial little Python session which attempts to use compiler.walk
(mostly unsuccessfully):
% python
Python 2.4.2 (#1, Feb 23 2006, 12:48:31)
on sunos5
Type "help", "copyright",...
|
by: Efrat Regev |
last post by:
Hello,
I'm trying to write something that will translate Python code to
pseudo-code (for teaching purposes). Googling around indicated that the
compiler module is pertinent, especially creating...
|
by: Mark Dufour |
last post by:
Hi all,
I have recently released version 0.0.20 and 0.0.21 of Shed Skin, an
optimizing Python-to-C++ compiler. Shed Skin allows for translation of
pure (unmodified), implicitly statically typed...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |