|
From: Fred J. <ph...@ya...> - 2005-07-16 18:48:18
|
Hello
I have this linker error which makes me think that the
definition file is not being seen by the linker, this
code is taken from "Thinking in C++, 2nd Edition,
Volume 1, Annotated Solutions Guide"
Using Dev-C++ 4.9.9.2, The error is:
[Linker error] undefined reference to f(int)
all the following files are in the same dir.
thanks
//: S03:Prototypes.h
void f(int);
///:~
//: S03:Prototypes.cpp {O}
// Implements functions declared in Prototypes.h
#include <iostream>
using namespace std;
void f(int i) {
cout << "f(" << i << ") returning void\n";
}
///:~
//: S03:ProtoTest.cpp
//{L} Prototypes
#include <iostream>
#include "Prototypes.h"
int main() {
f(1);
getchar();
return 0;
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|