when someone include <iostream> how does the compiler know which library to load?
serkan sendur 821 Postaholic Banned Featured Poster
Recommended Answers
Jump to PostThat's not a library reference, that's an include file reference.
The compiler (ok, maybe the preprocessor) will search for a file of the specified name through each of the directories in the include path. It will use the first file it finds. The contents of the file it finds …
Jump to PostMicrosoft C / C++ support an extension that a header file could use to add a default library to search. It is a preprocessor pragma that puts a comment record in the object files:
#pragma comment( lib, "emapi" )
(where 'emapi' could be any library name). The end effect when …
Jump to Post>how did the linker or compiler find the path to that IO library when all i do is only header inclusion?
Compiling and linking are two separate stages. The header is only relevant during compilation because declarations for the names you use must be present before you use them or …
All 10 Replies
Murtan 317 Practically a Master Poster
ArkM 1,090 Postaholic
serkan sendur 821 Postaholic Banned Featured Poster
ArkM 1,090 Postaholic
Murtan 317 Practically a Master Poster
serkan sendur 821 Postaholic Banned Featured Poster
Narue 5,707 Bad Cop Team Colleague
Murtan 317 Practically a Master Poster
serkan sendur 821 Postaholic Banned Featured Poster
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.