![]() |
|
#1
|
||||
|
||||
"undefined symbol" errorI've searched on the 'net for this error I didn't find anything that explained it. When I build my program, I get the error (also given as "undefined reference") at the point
CPP / C++ / C Code:
If I click on the actual error, I'm taken into the stl_vector.h file, which doesn't help me. As usual, I don't see anything obvious as to why this particular function call is giving me an error, unless it's related to my using a constant number. I've check my help files, but this particular error isn't listed. The only thing suggested on other sites is that something is unreadable, but I don't understand why that may be. CPP / C++ / C Code:
__________________
Start Programming with Python-A beginner's guide to programming and the Python language. ------------- Common Sense v2.0-Striving to make the world a little bit smarter. |
||||
|
#2
|
|||
|
|||
|
Quote:
The function prototype: CPP / C++ / C Code:
doesn't match definition: CPP / C++ / C Code:
first argument must match: const Note that functions containing "for" are not expanded inline, so the "inline" is ignored, but you must make const vector<double>.....match Regards, Dave |
|
#3
|
||||
|
||||
|
Asking this in a semi-rhetorical fashion, if the answer is that simple, why can't the error message be more descriptive? Even if it was something along the lines of "mismatched arguments" or something, I could have figured that out. Especially when I'm dumped into stl_vector.h when using my Linux builder. But running it under Metrowerks didn't help; it's help file didn't even have that particular error message.
I have to say, this is probably the biggest thing that pisses me off when programming, heck, even just using computers. Error messages are rarely understandable, if they're in English. (Don't get me started on Windows error messages). All right, I'm done ranting. Time to get back on topic. Thanks for the better eyesight. __________________
Start Programming with Python-A beginner's guide to programming and the Python language. ------------- Common Sense v2.0-Striving to make the world a little bit smarter. |
|
#4
|
|||
|
|||
|
Quote:
Due to the strict type checking of C++ and the ability to have two functions with the same name but different argument types, arguments of function definitions must exactly match the prototypes. When you get messages like this, you learn to check this. (At least now you have learned this.) "Undefined symbol" and such things mean different things for different conditions. It is definitely possible for compiler/linker writers to give more explicit error messages, and sometimes I sure wish they would. (Lots of things can cause a linker not to be able to find a missing function; how hard should the linker work to try to find close-but-not-exact matches?) My favorite error message used to be "Missing semicolon on line 123". My thoughts were, well if you (the compiler) are smart enough to know that, why don't you just put in the bloomin' semicolon? Then, of course I realized that I don't want the compiler to assume anything; the missing semicolin might be a byproduct of some really bad thing that I want to know about. Oh, well... Regards, Dave |
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Operator Overloading: << | aaroncohn | C++ Forum | 36 | 07-Dec-2004 20:22 |
| link error? | pablowablo | C++ Forum | 14 | 19-Jun-2004 11:00 |
| OpenGL always reports error | mvt | OpenGL Programming | 2 | 04-Jun-2004 07:42 |
| Visual C++ 6 Compiler error | vip3r | C++ Forum | 2 | 13-Apr-2004 15:34 |
| [script] E-mail webmaster error page | BobbyDouglas | PHP Code Library | 0 | 19-Aug-2003 21:10 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The