Solved

linking error with VC++ 5.0 linker

Posted on 2000-03-25
4
247 Views
Last Modified: 2010-04-10
Hi,
 Has anyone here ever face this problem with the linker:

I try to link two object files but i got unresolve external symbol when it is so obvious that the linker should "see" the function.. ie(assume we have two files a.cpp and b.cpp):

//in a.cpp
 void myFunction()
{

}

//I call the function in b.cpp ..I "declare" the prototype in b.cpp "extern void myFunction()"(Although it is not necessary since it "extern" by default(It seems to behave that way normally..))

The linker gives out unresolve external as soon as it links those objs. FYI, I'm using MS IDE (never try on my own makefile :))

I'm using:
WINNT 4.0 SP6 VC++5.0
0
Comment
Question by:nisa
  • 2
4 Comments
 

Accepted Solution

by:
nichole earned 10 total points
ID: 2657173
try extern in your function as well as
your declares:

// declare in header
extern void myFunction();

// implementation
extern void myFunction()
{

}



0
 
LVL 9

Expert Comment

by:Pacman
ID: 2663719
Could you post your code of definition, declaration and call.
0
 
LVL 9

Expert Comment

by:Pacman
ID: 2663726
PS: "unresolved external" means NOT that your object isn't declared.
It means it's not DEFINED. This has nothing to do with your declaration.
0
 

Author Comment

by:nisa
ID: 2669100
Hi all,
   Sorry for late comment, anyway I tried to make another program in the same manner then it works(It should work anyway!!). However the one that I have problem with, is linked with someone elses object code that was compiled with VC++ 6.0(whereas i'm using VC++5.0). I should take a close look that those codes again :).


Best Regards,

Nisa.

Ps(Pacman): yes u are right "not DEFINE" is technically correct term for it , thanks for pointing that out :).
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Find Visual Studio Tools 2 111
Socket Programming (Unix) 8 139
operator overload: incompatible type and too many params 5 82
Copy output image from TWindowsMediaPlayer 6 48
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question