Linker error 1104

F

Felix

After porting a project from VC6 to VC.NET 2003 I have a very strange
problem generating
link error 1104 for import libraries. I just ported the project and made
some small adaptions so
it fits the new IDE. The project itself links against some import libraries
belonging to dll's I
wrote (these dll's have been ported too, of course).

To keep things simple I only use one import library here. To tell the linker
it should link against
the import library 'ltechexd.lib' I go to the 'project
properties/linker/input' and add it on the line
'additional dependencies'. When I now look at the linker command line it
looks like this:

/OUT:".\Debug/MCSProg.exe" /INCREMENTAL /NOLOGO /DEBUG
/PDB:".\Debug/MCSProg.pdb"
/SUBSYSTEM:WINDOWS /MACHINE:X86 ltechexd.lib "p\ImpLib\ltechexd.lib"

This is wrong; the correct linker command line would be:

/OUT:".\Debug/MCSProg.exe" /INCREMENTAL /NOLOGO /DEBUG
/PDB:".\Debug/MCSProg.pdb"
/SUBSYSTEM:WINDOWS /MACHINE:X86 ltechexd.lib

Somehow "p\ImpLib\ltechexd.lib" creeps in and it is this generating the
linker error 1104 (which is fine
since there is no such thing like "p\ImpLib\ltechexd.lib").
What is this "p\ImpLib\ltechexd.lib" and where does it come from? It is not
even a correct path. All import
libraries are stored at \\jupiter\cpp\implib. This path was also added to
the library paths of VC++ directories.

If I remove the import library from 'project properties/linker/input' and
instead add it to the 'additional options'
of the linker's command line, everything is fine and I get the correct
command line and there are of course
no more linker errors.

Deleting _all_ intermediate files of the project and recreating the import
libraries did not help.

Any Idea what could be wrong with this?
 
H

Holger Grund

'additional dependencies'. When I now look at the linker command line it
looks like this:

/OUT:".\Debug/MCSProg.exe" /INCREMENTAL /NOLOGO /DEBUG
/PDB:".\Debug/MCSProg.pdb"
/SUBSYSTEM:WINDOWS /MACHINE:X86 ltechexd.lib "p\ImpLib\ltechexd.lib"
[..]
Somehow "p\ImpLib\ltechexd.lib" creeps in and it is this generating the
linker error 1104 (which is fine
since there is no such thing like "p\ImpLib\ltechexd.lib").
What is this "p\ImpLib\ltechexd.lib" and where does it come from? It is
not
There's an option in the IDE that automatically links against the import
libraries
generated for projects in the same solution that your project depends on.

If you have a project in the solution that generates ltechexd.lib you should
change the setting under Linker->General->Ignore Import Library to Yes.

Also see "IgnoreImportLibrary property"
libraries are stored at \\jupiter\cpp\implib. This path was also added to
the library paths of VC++ directories.

If I remove the import library from 'project properties/linker/input' and
instead add it to the 'additional options'
of the linker's command line, everything is fine and I get the correct
command line and there are of course
no more linker errors.
That's odd. Maybe you have some bad character in the XML markup
of your project file? I have no idea what would cause this.

-hg
 

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