468,537 Members | 1,922 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

NAnt linking problems : LNK1256

Hello,

I have a C++ mixed mode dll ( unmanaged/managed ) that wraps a C#
dll to provide some functionality for Microsoft Excel. I am able to
compile my solution fine in Visual Studio .NET 2003 and it links and
works with no errors. There is a desire at my company to have things
checked out of source control and built on a machine dedicated to
building to remove the "I don't know, it works on my machine" problem.

I have created an NAnt script which compiles my C++ classes and then
attempts to link them into a dll. I made sure that the parameters that
are passed to the cl task and the link task are the same as in the
build log that MSVC .Net generates when it builds the solution
correctly.

However at the end of the build I get this error :
[link] LINK : fatal error LNK1256: ALINK operation failed
(8013110E) :

I looked around on MSDN and it said that there might be some version
incompatibility between the linker and alink.dll. My versions appear to
be in line with what is distributed on the CD.

I saw another posting that link needs the windir set within the
command shell you are using. In my command prompt it is set.

Has anyone run into a similar problem. Does anyone have an idea? Does
the hex value within the parenthesis have any meaning?

Thanks,
Harley Blumenfeld

Apr 13 '06 #1
4 1691
Do you sure you execute this from the VS 2003 command propmt?
Do you also have VS 2002 or VS 2005 installed on the machine?

<ha******@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Hello,

I have a C++ mixed mode dll ( unmanaged/managed ) that wraps a C#
dll to provide some functionality for Microsoft Excel. I am able to
compile my solution fine in Visual Studio .NET 2003 and it links and
works with no errors. There is a desire at my company to have things
checked out of source control and built on a machine dedicated to
building to remove the "I don't know, it works on my machine" problem.

I have created an NAnt script which compiles my C++ classes and then
attempts to link them into a dll. I made sure that the parameters that
are passed to the cl task and the link task are the same as in the
build log that MSVC .Net generates when it builds the solution
correctly.

However at the end of the build I get this error :
[link] LINK : fatal error LNK1256: ALINK operation failed
(8013110E) :

I looked around on MSDN and it said that there might be some version
incompatibility between the linker and alink.dll. My versions appear to
be in line with what is distributed on the CD.

I saw another posting that link needs the windir set within the
command shell you are using. In my command prompt it is set.

Has anyone run into a similar problem. Does anyone have an idea? Does
the hex value within the parenthesis have any meaning?

Thanks,
Harley Blumenfeld

Apr 13 '06 #2
I am sure that I don't have Visual Studio 2005 on this machine.
My development machine was imaged from a machine that had
Visual Studio 2002 on it, but I uninstalled that before I installed
VS 2003 .NET.

The only version of alink.dll that I have is in the
C:\WINNT\Microsoft.NET\Framework\v1.1.4322
directory and is version 7.10.3052.4.

The version of the linker that I have is in
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
and it's version is 7.10.3077.0 which is higher than the other
version so that is probably the reason for the error.

What I am wondering is why it works within Visual Studio, but not from
NAnt when I only have 1 version of the linker and the required dll?

Also I believe that I am using the exact linker from the command prompt
as VS 2003 because I am taking the options from the build log.

Thanks for replying...

-Harley

Apr 17 '06 #3
I have the same versions of link.exe and alink.dll as you. Could it be a
conflict with another DLL that is by accident named alink.dll?

Marcus

"harley" <ha******@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
I am sure that I don't have Visual Studio 2005 on this machine.
My development machine was imaged from a machine that had
Visual Studio 2002 on it, but I uninstalled that before I installed
VS 2003 .NET.

The only version of alink.dll that I have is in the
C:\WINNT\Microsoft.NET\Framework\v1.1.4322
directory and is version 7.10.3052.4.

The version of the linker that I have is in
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
and it's version is 7.10.3077.0 which is higher than the other
version so that is probably the reason for the error.

What I am wondering is why it works within Visual Studio, but not from
NAnt when I only have 1 version of the linker and the required dll?

Also I believe that I am using the exact linker from the command prompt
as VS 2003 because I am taking the options from the build log.

Thanks for replying...

-Harley

Apr 18 '06 #4
I got it to work!!!!

The problem was with the way that NAnt handles modules... or maybe I
just misunderstood how nant handles modules. I had assumed that the
<modules/> section of the link task would just include a list of
modules like VS 2003 .NET does at the end of the command line, before
the object files.

However it does not, instead nant adds /ASSEMBLYMODULE:[path to module]
for each one it finds in the the modules fileset. I guess the
documentation could be a little clearer.

In my modules section I had this xml :
<modules>
<include name="kernel32.lib" />
<!-- removed for brevity /-->
<include name="c:/Program Files/Microsoft Visual Studio .NET
2003/Sdk/v1.1/Lib/mscoree.lib">
</modules>

So NAnt was adding /ASSEMBLYMODULE:c:/Program Files/Microsoft Visual
Studio .NET 2003/Sdk/v1.1/Lib/mscoree.lib to the linker command line.
NAnt was ignoring kernel32.lib and all the other modules since I did
not set a basedir attribute of the modules section, and it could not
find them.

I removed my modules section and added the lib files I needed to the
options attribute of the task element to mimic the way the linker in VS
2003.NET calls the linker.

I was tipped of to the cause of the problem by this bug on sourceforge.
http://sourceforge.net/tracker/index...50&atid=402868

Thank you for all your help Marcus.

-Harley

Apr 18 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by hoochiegooch | last post: by
1 post views Thread by Nigel Currie | last post: by
reply views Thread by muesliflakes | last post: by
2 posts views Thread by Ireneus Broncel | last post: by
12 posts views Thread by michael sorens | last post: by
reply views Thread by Brett Romero | last post: by
reply views Thread by james.mcdonagh | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.