By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,512 Members | 3,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,512 IT Pros & Developers. It's quick & easy.

Linker Error

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.