Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

question about building LIB's

Brian_Murphy
新規コントリビューター II
653件の閲覧回数

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?

0 件の賞賛
5 返答(返信)
Steven_L_Intel1
従業員
653件の閲覧回数

No, you won't get ANY unresolved externals when building a static library. All that resolving happens at link time.

mecej4
名誉コントリビューター III
653件の閲覧回数

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.

Brian_Murphy
新規コントリビューター II
653件の閲覧回数

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.

Brian_Murphy
新規コントリビューター II
653件の閲覧回数

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.

Steven_L_Intel1
従業員
653件の閲覧回数

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.)

返信