Skip to main content
gamedev.net
🔒 Locked

problem __inline !!!

Started by browny 3 replies 350+ views
Original Post
browny
browny
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
browny
browny
SOMEBODY PLEASE HELPPPPPPPPP !!!!!!!!!!
Z
Oluseyi
Oluseyi
Inline function definitions need to be in the same file as their declarations in MSVC (don''t know what the standard says about this).
Oluseyi
Oluseyi
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.