Slightly OT question about lnk error 1104 in visual studio

P

pauldepstein

I am using the latest version of Visual c++ on windows XP.
I am trying to build a project and get a lnk1104 error regarding a
file of the form .../../ ProjectName.lib No other errors, just this
one.
I've googled this error but not found anything useful at my newbie
level. I understand the issue may be one of including the right
files. I therefore went to Additional Include Directories on the
Property Pages but I would need help working out what I need to do to
verify that the paths there are correct.

Can anyone advise or provide a URL for this problem? Perhaps this
isn't a language question, and I apologise if I'm slightly OT but
this
is a very urgent matter for me so I was keen to pick among the high-
activity newsgroups.

Thank you very much for your help,


Paul Epstein
 
J

jason.cipriani

Can anyone advise or provide a URL for this problem?

http://vcfaq.mvps.org/lang/10.htm

First Google result for LNK1104.
Perhaps this
isn't a language question,

It's not.
and I apologise if I'm slightly OT

You are.
but this
is a very urgent matter for me so I was keen to pick among the high-
activity newsgroups.

I guess I've been there, too. You probably aren't going to hell.
Although from now on you should stick to relevant newsgroups; these
ones are high-activity enough already. In your case, it might be
something like microsoft.public.dotnet.languages.vc or
microsoft.public.vc; but don't quote me on that.
Thank you very much for your help,

That said:

1) Make sure ProjectName.lib actually exists somewhere.

2) Make sure ProjectName.lib is in your library path. If you need a
quick fix, find ProjectName.lib, and specify the absolute path in your
additional library directories as per the instructions in the link
above. For example, if you have "c:\somewhere\ProjectName.lib", add "c:
\somewhere" to your library directories. You could also just specify
the absolute path in the library list; instead of "..\..
\ProjectName.lib", change it to "c:\whatever\ProjectName.lib" -- or
just remove the path entirely, leave it as "ProjectName.lib", make
sure it's in your library path, and VC should find it.

You did not give enough information for a more specific answer. In
general, when you link to .lib files, the linker will search the
library paths you have defined. If you link to "..\a.lib" then it will
look for that relative path in the library paths you have set up, so
if "C:\whatever" is a library path, it will look for "c:\whatever\..
\a.lib", which is just "c:\a.lib". So be aware of that, too. If that
makes sense.

Sorry for the sloppy answer, it's all I can think about right now.
It's getting late.

Also, again, this isn't the place to ask, so I would not get your
hopes up too high.

Jason
 
P

pauldepstein

http://vcfaq.mvps.org/lang/10.htm

First Google result for LNK1104.


It's not.


You are.


I guess I've been there, too. You probably aren't going to hell.
Although from now on you should stick to relevant newsgroups; these
ones are high-activity enough already. In your case, it might be
something like microsoft.public.dotnet.languages.vc or
microsoft.public.vc; but don't quote me on that.


That said:

1) Make sure ProjectName.lib actually exists somewhere.

2) Make sure ProjectName.lib is in your library path. If you need a
quick fix, find ProjectName.lib, and specify the absolute path in your
additional library directories as per the instructions in the link
above. For example, if you have "c:\somewhere\ProjectName.lib", add "c:
\somewhere" to your library directories. You could also just specify
the absolute path in the library list; instead of "..\..
\ProjectName.lib", change it to "c:\whatever\ProjectName.lib" -- or
just remove the path entirely, leave it as "ProjectName.lib", make
sure it's in your library path, and VC should find it.

You did not give enough information for a more specific answer. In
general, when you link to .lib files, the linker will search the
library paths you have defined. If you link to "..\a.lib" then it will
look for that relative path in the library paths you have set up, so
if "C:\whatever" is a library path, it will look for "c:\whatever\..
\a.lib", which is just "c:\a.lib". So be aware of that, too. If that
makes sense.

Sorry for the sloppy answer, it's all I can think about right now.
It's getting late.

Also, again, this isn't the place to ask, so I would not get your
hopes up too high.

Jason

Thanks a lot Jason, for your thoughtful response. The link you gave
was indeed helpful but I somehow didn't spot it. I tried the search
"lnk1104 error". I did include the library paths explicitly as you
suggested, but the problem was not resolved. I'm aware that you
probably need more info, but my problem is that I don't know what
information to give.

If you enjoy helping, and have time, we could discuss this via email
or messenger. My email is pauldepstein at yahoo dot com

Re the irrelevant newsgroup complaint, I would say in my defence that
I deliberately put OT in the subject title so that no one's time was
wasted who was concerned to stay strictly on-topic.

Paul Epstein
 
J

jason.cipriani

I did include the library paths explicitly as you
suggested, but the problem was not resolved. I'm aware that you
probably need more info, but my problem is that I don't know what
information to give.

1) What is your global library search path, from:

Tools -> Options -> Projects & Solutions -> VC++ Directories ->
Library Files

2) What is your project library search path (for whatever build
configuration you are using, "Debug" and/or "Release" and/or any
custom ones you have made), from:

Project Properties -> Linker -> General -> Additional Library
Directories

3) What libraries are you explicitly linking to, from:

Project Properties -> Linker -> Input -> Additional Dependencies

4) What is the *exact* error message you are receiving?

5) What is the full path to the existing ProjectName.lib file that you
believe the linker should be finding, but isn't?

LNK1104 means it was looking for a library and did not find it. The
library needs to be in your library search paths. If the library does
not exist, or is not in one of the library paths, then it will not
work, period. Does the library exist? Is it in your search paths?
If you enjoy helping, and have time, we could discuss this via email
or messenger. My email is pauldepstein at yahoo dot com

We can keep it here for now; at least if some other problem is
discovered other people will be able to find it. Also I hate helping
people and do not have much free time. :p
Re the irrelevant newsgroup complaint, I would say in my defence ...

I don't think that's how it works. :)

Jason
 
P

pauldepstein

1) What is your global library search path, from:

  Tools -> Options -> Projects & Solutions -> VC++ Directories ->
Library Files

2) What is your project library search path (for whatever build
configuration you are using, "Debug" and/or "Release" and/or any
custom ones you have made), from:

  Project Properties -> Linker -> General -> Additional Library
Directories

3) What libraries are you explicitly linking to, from:

  Project Properties -> Linker -> Input -> Additional Dependencies

4) What is the *exact* error message you are receiving?

5) What is the full path to the existing ProjectName.lib file that you
believe the linker should be finding, but isn't?

LNK1104 means it was looking for a library and did not find it. The
library needs to be in your library search paths. If the library does
not exist, or is not in one of the library paths, then it will not
work, period. Does the library exist? Is it in your search paths?


We can keep it here for now; at least if some other problem is
discovered other people will be able to find it. Also I hate helping
people and do not have much free time. :p


I don't think that's how it works. :)

Jason

Hi Jason,

Thanks a lot for your input on this issue. I did actually post also
to a more relevant ng microsoft.public.vc.language (I think) but got
no respondents. [Admittedly, even that one was slightly off-topic
because it's not a language issue.] I fully agree that my posting was
a breach of etiquette. I hate doing this but I hate being stuck even
more. My own opinion is that ng etiquette could be changed such that
questions of my type can be posed so long as they are labelled as OT.
In any case, the real breach-of-etiquette problem is the commercial
spam. Fussing about other things is a bit like putting a band-aid on
a cancer (I got that cliche from Chomsky).

I resolved this problem by checking out the .lib files using our
source code control system. I had no idea that my problem was
anything to do with source code control which is why I didn't think to
mention it earlier.
Anyway, problem resolved, so I feel much better. And thanks again for
your help.

Paul Epstein
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top