- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If A.LIB calls routines in B.LIB, can A.LIB be built before B.LIB has been built?
The reason I'm asking this is for times when I'm not sure if A.LIB is actually calling any routines in B.LIB. If B.LIB is being called, but I don't have it, will I get unresolved externals when building A.LIB or when building the final main program that pulls everything together?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, you won't get ANY unresolved externals when building a static library. All that resolving happens at link time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Think about this point: when you compile and link any Fortran program, your sources get compiled into *.OBJ files which are then linked to the libraries that came with the compiler. Those libraries could have been built weeks/months/years before your own object and library files were created.
For the whole build system to work, there can be no required temporal precedence rules that govern the files that are presented to the linker, other than the requirement that all of them should exist before the linker is asked to build the EXE or DLL that you request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Steve. That's exactly what I want to find out.
I will soon be taking my first steps into using Intel's MKL to utilize its Lapack routines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
mecej4 - My knowledge of the overall build process is skimpy. I wasn't sure if building A.LIB was itself a linking process that required B.LIB.
Is it correct that a .LIB file made from fifty .obj files is just a simple container for the fifty .obj files? I suppose mainly for convenience purposes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, that's really all it is. (Unless you build those .OBJs into a DLL in which case the .LIB is an "import library" that serves to connect DLLEXPORTed names to locations in the DLL.)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page