Linker error?

This is a discussion on Linker error? within the C++ Programming forums, part of the General Programming Boards category; Hey guys,
So again, I'm trying to create one of the practice programs from my textbook without looking at the ...

Linker error?

So again, I'm trying to create one of the practice programs from my textbook without looking at the book's code. I want to test my skills...

But failure has befallen me and I've given up for tonight. Hopefully one of you can figure this one out.

So far, I have created three arrays: One for product numbers (int), one for the number of units sold (int), and another for sales (double). The directions say to display the list of products in the order of their sales from highest to lowest. The point of the exercise is to practice the selection sort algorithm.

Now, I'm not 100% sure that I did the sort algorithm correctly, so I ask that you don't point out any errors in that function unless you think that it is the cause of my problem:

Even with the dualSort function commented out (as well as the function call, of course), I cannot get the displaySales function to work. I get two linker errors:

There is just one other question that I have: Why do I need to use the NUM_PROD constant as an argument in my function calls? I thought that the whole point of a global variable/constant was that you could reference it in any function. :S

^ Thank you for the tip. I have just been following the format presented in my textbook, but I found that (especially while writing this code) it was really confusing trying to make sure that I had all of the arguments of each function body arranged properly since two had a mix of integers and doubles.

I'm really making an effort not to get into any bad habits. I want to learn how to code and I want to learn to do it properly.

I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.