Visual C++ .Net compiler error

den1jay

Newcomer
Joined
May 28, 2003
Messages
1
hi !

I am a newbie to .net technology .. got unix/c background, struggling to port myself on microsoft by learning .net. My problem is that when i compiled helloCP.cpp example program given in .net framework documentation at the command shell i got following error ... please note i am not using Visual Studio.Net.

/out helloCp.exe
/debug
LINK: fatal error LNK1256:ALINK operation failed <8013144E> : Unexpected exception processing attribute -- system. ArgumentException : Unable to generate permission set; input XML may be malformed...

P.S - I am using WinXP Pro, and have already set LIB and INCLUDE env var to their paths. Is it an error because of wrong env var name or something else ? Thanks in advance.
 
Hi,

I get the exact same error when linking object files, generated out of C++ source files, to a DLL on the command line.

The command used is:
[
link /nologo /VERBOSE /LIBPATH:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib" /OUT:"D:\dotNET\work\projects\OPC\OpcTest1\Debug\OpcTest1.dll" /INCREMENTAL /NOLOGO /DLL /DEBUG /ASSEMBLYDEBUG /PDB:"D:\dotNET\work\projects\OPC\OpcTest1\Debug/OpcTest1.pdb" /FIXED:No /noentry nochkclr.obj mscoree.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib .\Debug\AssemblyInfo.obj .\Debug\OpcTest1.obj .\Debug\app.res
]

The output generated by the linker is:
[
Starting pass 1

Invoking LINK.EXE:
/nologo /VERBOSE /LIBPATH:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib" /LIBPATH:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib" /OUT:"D:\dotNET\work\projects\OPC\OpcTest1\Debug\OpcTest1.dll" /INCREMENTAL /NOLOGO /DLL /DEBUG /ASSEMBLYDEBUG /PDB:"D:\dotNET\work\projects\OPC\OpcTest1\Debug/OpcTest1.pdb" /FIXED:No /noentry nochkclr.obj mscoree.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib .\Debug\AssemblyInfo.obj .\Debug\OpcTest1.obj .\Debug\app.res
/incremental:no
/nologo
/fullbuild

Starting pass 1

Searching libraries
Searching C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\mscoree.lib:

Finished searching libraries

Searching libraries
Searching C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\mscoree.lib:
Found __CorDllMain@12
Loaded mscoree.lib(mscoree.dll)
Found __IMPORT_DESCRIPTOR_mscoree
Referenced in mscoree.lib(mscoree.dll)
Loaded mscoree.lib(mscoree.dll)
Found __NULL_IMPORT_DESCRIPTOR
Referenced in mscoree.lib(mscoree.dll)
Loaded mscoree.lib(mscoree.dll)
Found mscoree_NULL_THUNK_DATA
Referenced in mscoree.lib(mscoree.dll)
Loaded mscoree.lib(mscoree.dll)

Finished searching libraries

Finished pass 1


Invoking CVTRES.EXE:
/machine:x86
/verbose
/out:"C:\WINNT\TEMP\lnk1E3C.tmp"
/readonly
".\Debug\app.res"
Microsoft (R) Windows Resource To Object Converter Version 7.10.3052.4
Copyright (C) Microsoft Corporation. All rights reserved.

adding resource. type:ICON, name:1, language:0x0409, flags:0x1010, size:744
adding resource. type:ICON, name:2, language:0x0409, flags:0x1010, size:296
adding resource. type:GROUP_ICON, name:1, language:0x0409, flags:0x1030, size:34
LINK : fatal error LNK1256: ALINK operation failed (8013144E) : Unexpected exception processing attribute -- System.ArgumentException: Unable to generate permission set; input XML may be malformed..
]

The entire commandline was copied from the BuildLog of Microsoft Visual Studio .NET 2003. From within VS the linker does NOT crash but continues the build with pass 2 and generates the requested DLL.

Does anybody know what causes the commandline to fail?
 
Hi again,

I have found the answer to my problem on one of the google discussion groups (LNK1256 error when linking any MC++ source ).

In short; Sam Norris found out that the environment variable WINDIR needs to be set.

And although it was set as a system environment variable it was indeed for some reason NOT set in my DOS box.

After setting it manually the link operation completes without errors.
 
Back
Top