Linker Error Undefined Symbol Printf
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn linker error undefined symbol in module more about Stack Overflow the company Business Learn more about hiring developers or how to solve linker error in c posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community linker error undefined symbol in c Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Linker error undefined reference to `print' up vote 1 down linker error undefined symbol _printf in module vote favorite I have a program named "main.c" containing the main() that calls a function whose definition is available in other source file named "nim.c". I made a header file named "nim.h" that contains the prototype of the required method. This header file "nim.h" is already included it in my "main.c". I am putting up all the files that are part of this program. //main.c #include
Linker Error Unable To Open File Tclass Lib
"nim.h" int main() { print(); return 0; } //nim.h #include
View All Answers My Questions Articles Tutorial Tips, Tricks & Techniques News Database Support Community Forums Search Recent DiscussionsResourcesQuality PortalEvents CalendarEmbarcadero on YouTube Job BoardRegistered User DownloadsTrial Downloads Books Login Register HomeArticlesTips, Tricks & TechniquesPROGRAMMINGResolving Undefined
How To Remove Linker Error In C
Symbol linker messages. Resolving Undefined Symbol linker messages. Written by Embarcadero USA. Posted in undefined symbol in module c++ PROGRAMMING Technical Information Database TI867C.txt Resolving Undefined Symbol linker messages. Category :General Platform :All Product :Borland C++ 3.x Description: The purpose of linker error in c++ undefined symbol this document is to provide an overview of the Linking process and help in identifying causes of 'unresolved external symbols'. The code for printf is in a module in the run time library. When one calls http://stackoverflow.com/questions/14871679/linker-error-undefined-reference-to-print printf in a C/C++ module, the compiler creates a record ( referred to as EXTDEF - EXTernal DEFinition ) which indicates the call to an 'extern'al function. The linker then looks at that OBJ, along with all the other modules and libraries specified and attempts to find another module ( .OBJ or .LIB ) which defines/provides the symbol printf. If successful in the search, the call is printf is resolved; Otherwise the linker http://community.embarcadero.com/article/technical-articles/162-programming/14893-resolving-undefined-symbol-linker-messages generates an error indicating that 'printf' is an undefined symbol. The error message, however, is very often not the result of leaving out the module containing the symbol being looked for but rather a discrepancy between the name used by the caller ( the C/C++ module calling printf() in the case mentioned above ) and the supplier ( the LIBRARY containing the code to printf() ). The *real* name of any symbol is almost always different from the name/identifier used by the programmer. For example, the *real* name ( by *real* name we mean the idenfier used/generated by the tools ) of strcpy is: '_strcpy'. The *real* name of a symbol depends on the various settings and options. The relevant ones are list below: Calling Conventions: > cdecl > pascal > fastcall Compiler Settings: > generate underbars > unsigned chars ( C++ only ) Optimizations: > Object Data Calling ( C++ only ) Virtual Table: > Far Virtual Tables Language used: > C > C++ > Assembly Furthermore there are two options which will affect how the linker attempts to match symbols: > Case sensitive link > Case sensitive exports ( Windows only ) The following is a discussion of how the above mentioned options affect the *real* name of symbols, hence the resolution of symbols
1 of 1 New Topic/Question Reply 5 Replies - 16595 Views - Last Post: 09 April 2012 - 12:25 PM Rate Topic: #1 rjkr10 New D.I.C Head Reputation: 0 Posts: 2 Joined: http://www.dreamincode.net/forums/topic/274435-link-error-undefined-reference-to-printf/ 08-April 12 [Link error] Undefined reference to printf Posted 08 April 2012 - 11:55 PM Hi, Compiler used:Dev c++ While compiling the below code linked error is displayed ,undefined reference to printf #include