469,628 Members | 1,205 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Linker Error

Hello All,

I have a Visual C++ 2003 dll solution in a directory called "Antenna
Test Range Control", and when I comile it, I get the error LNK1104:
cannot open file "antenna.obj". When I remove teh spaces in my solution
directory, I get the following errors:

MastController.exp : error LNK2001: unresolved external symbol _Calibrate@8
MastController.exp : error LNK2001: unresolved external symbol _Initialize@8
MastController.exp : error LNK2001: unresolved external symbol _IsAlive@4
MastController.exp : error LNK2001: unresolved external symbol _IsMoving@4
MastController.exp : error LNK2001: unresolved external symbol _MoveAz@12
MastController.exp : error LNK2001: unresolved external symbol _MoveEl@12
MastController.exp : error LNK2001: unresolved external symbol
_NotifyOnComplete@8
MastController.exp : error LNK2001: unresolved external symbol _Stop@0
I know this is a linker problem, but I don't know what to do.

Any ideas? Thanks.

-Joel
Nov 17 '05 #1
4 1582
Don't remove the spaces - if you do that the path becomes invalid since
there's no such directory.

Put quotes around the full path : e.g. "c:\abc and zyx\lots of spaces in
this folder\a b c d....."

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Joel Whitehouse" <jo************@gmail.com> wrote in message
news:O7**************@TK2MSFTNGP10.phx.gbl...
Hello All,

I have a Visual C++ 2003 dll solution in a directory called "Antenna Test
Range Control", and when I comile it, I get the error LNK1104: cannot open
file "antenna.obj". When I remove teh spaces in my solution directory, I
get the following errors:

MastController.exp : error LNK2001: unresolved external symbol
_Calibrate@8
MastController.exp : error LNK2001: unresolved external symbol
_Initialize@8
MastController.exp : error LNK2001: unresolved external symbol _IsAlive@4
MastController.exp : error LNK2001: unresolved external symbol _IsMoving@4
MastController.exp : error LNK2001: unresolved external symbol _MoveAz@12
MastController.exp : error LNK2001: unresolved external symbol _MoveEl@12
MastController.exp : error LNK2001: unresolved external symbol
_NotifyOnComplete@8
MastController.exp : error LNK2001: unresolved external symbol _Stop@0
I know this is a linker problem, but I don't know what to do.

Any ideas? Thanks.

-Joel

Nov 17 '05 #2
Nishant Sivakumar wrote:
Don't remove the spaces - if you do that the path becomes invalid since
there's no such directory.

Put quotes around the full path : e.g. "c:\abc and zyx\lots of spaces in
this folder\a b c d....."

Ooops - I'm sorry - I should've specified that I renamed the containing
directory to a name with no spaces - I didn't change any of the code in
the project. However, the environment macros *did* change to reflect
the change in $(SolutionPath) and such.

-Joel
Nov 17 '05 #3
Okay, I went into the linker options and put double quotes around my
"Additional Dependancies," which brings about the same effects as
putting the project in a path with no spaces, except that I now have a
new problem with "__DllMainCRTStartup@12"...

Here are the errors that I get:

LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
MastController.exp : error LNK2001: unresolved external symbol _Calibrate@8
MastController.exp : error LNK2001: unresolved external symbol _Initialize@8
MastController.exp : error LNK2001: unresolved external symbol _IsAlive@4
MastController.exp : error LNK2001: unresolved external symbol _IsMoving@4
MastController.exp : error LNK2001: unresolved external symbol _MoveAz@12
MastController.exp : error LNK2001: unresolved external symbol _MoveEl@12
MastController.exp : error LNK2001: unresolved external symbol
_NotifyOnComplete@8
MastController.exp : error LNK2001: unresolved external symbol _Stop@0
Debug/MastController.dll : fatal error LNK1120: 9 unresolved externals

What do I do to resolve them?

-Joel
Nov 17 '05 #4
Joel Whitehouse wrote:
Okay, I went into the linker options and put double quotes around my
"Additional Dependancies," which brings about the same effects as
putting the project in a path with no spaces, except that I now have a
new problem with "__DllMainCRTStartup@12"...

Here are the errors that I get:

LINK : error LNK2001: unresolved external symbol
__DllMainCRTStartup@12 MastController.exp : error LNK2001: unresolved
external symbol _Calibrate@8 MastController.exp : error LNK2001:
unresolved external symbol _Initialize@8 MastController.exp : error
LNK2001: unresolved external symbol _IsAlive@4 MastController.exp :
error LNK2001: unresolved external symbol _IsMoving@4
MastController.exp : error LNK2001: unresolved external symbol
_MoveAz@12 MastController.exp : error LNK2001: unresolved external
symbol _MoveEl@12 MastController.exp : error LNK2001: unresolved
external symbol _NotifyOnComplete@8 MastController.exp : error LNK2001:
unresolved external symbol _Stop@0
Debug/MastController.dll : fatal error LNK1120: 9 unresolved externals

What do I do to resolve them?


Add /verbose to your linker command line options and study the output
produced. Are the files where you expect those symbols to be defined
actually being included in the link?

Use dumpbin /symbols on the .obj files that should define those symbols - do
they in fact define them?

-cd
Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Baloff | last post: by
1 post views Thread by Laszlo | last post: by
5 posts views Thread by Pradnyesh Rane | last post: by
3 posts views Thread by Steve Baer | last post: by
9 posts views Thread by Peter Oliphant | last post: by
1 post views Thread by Felix | last post: by
3 posts views Thread by Rahul | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.