Linker Error

  • Thread starter Thread starter Joel Whitehouse
  • Start date Start date
J

Joel Whitehouse

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
 
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....."
 
Nishant said:
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
 
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
 
Joel said:
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
 
Back
Top