problem __inline !!!

Started by
3 comments, last by browny 22 years, 4 months ago
maybe its just my ignorance of C/C++ programming which led me into this problem. Anyways.... i have a header file where i prototyped one function like this: // header.h inline ToRad __cdecl (float deg); // end of header file then i wrote the actual code in a CPP file like this inline ToRad __cdecl (float deg) { //blah blah } but the program wouldn''t link in RELEASE mode while it does quite gracefully in DEBUG mode !! ( What''s goin on ??) the error message that pops up in the RELEASE mode is : error: LNK2001: unresolved external symbol "float __cdecl (float)" by the way, i''m compiling it using VC++ 6.0
Z
Advertisement
SOMEBODY PLEASE HELPPPPPPPPP !!!!!!!!!!
Z
Inline function definitions need to be in the same file as their declarations in MSVC (don''t know what the standard says about this).
For future reference, if you look up the error code in MSDN you''ll find the answer really quickly. For example, if you enter LNK2001 (the error code in this case), you find a list of "Coding Problems" that can cause LNK2001. Inline definitions in a .CPP file is the second in that list.
He''s correct, but to add more: The reason it links in debug is because the inline keyword is ignored and it thinks you''re doing a normal function.

[Resist Windows XP''s Invasive Production Activation Technology!]

This topic is closed to new replies.

Advertisement