- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the effect of the objcomment below:
module Thislibrary
!Dec$ Objcomment: 'ThisLibrary.lib'
...
end module
Where the module is compiled into a static lib and the string in the objcomment is the library name itself.
reason I ask:
I have a library which has this in it, presumably so that it becomes a general purpose lib and not needed on the compile command. The library has been compiled on another pc and moved to a different project and copied in the lib path. But hwile the mod file is recognized, the linker acts as if it cannot find the lib file at all.
any hints will be appreciated.
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The effect is as if ThisLibrary.lib was added to the list of objects/libraries on the linker input property page. The linker will search its normal library paths to find the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
What you say is almost identical to what the help files say.But it is not clear enough for the standard issue dummy.
1. Is the purpose so that if there are conflicting routines in differnt libraries, to give one library precedence, correct?
2. If the objcomment name is the SAME as the library name itself, the objcomment does absolutelynothing, correct?
3.If none of theroutines in the objcomment lib are found in the default libraries, the directive is moot to the final project. correct? (I suppose this is the same as question1)
4. Any idea whymy lib file is being totally ignored by a command line compile of a dll which uses the lib?
I say ignored because every single call to routines in the lib file come up as unresolved, linkerr2001. Also I have verified using dumpbin that all these routines are in fact in the lib.
I've tried putting the lib&mod file in the same folder as the working directory, as well as DF98lib.
The mod file seems to be found withuot trouble, which is why I suspected the objcomment.
'd Appreciate any further hints.
Message Edited by Rahzan on 02-10-2005 11:14 AM
Message Edited by Rahzan on 02-10-2005 11:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. There is no precedence involved. It's just another library name added to the list that the linker looks for. You don't have explicit control over which order the libraries are looked for.
The purpose is to say "If you use me, you also need this other library".
2. It makes no sense for an objcomment in a library to reference the same library.
3. No - the linker will complain if it can't find the library, just as it would if you listed it on the Linker properties page
4. The objcomment will be seen only if something forces the object module containing it to be referenced from the .lib. For example, if you have module procedures, the code for those is in the .obj inserted. But just having the objcomment in the library with nothing referencing the object module will do nothing. This latter is probably your issue.
The purpose is to say "If you use me, you also need this other library".
2. It makes no sense for an objcomment in a library to reference the same library.
3. No - the linker will complain if it can't find the library, just as it would if you listed it on the Linker properties page
4. The objcomment will be seen only if something forces the object module containing it to be referenced from the .lib. For example, if you have module procedures, the code for those is in the .obj inserted. But just having the objcomment in the library with nothing referencing the object module will do nothing. This latter is probably your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Real sorry to be dense, but at least you verified impression #2.
1. Your statement "If you use me, you also need this other library". makes good sense, except that if he library is in the same folder or on the lib-path then objcomment is not needed at all. correct?
2. I just can't follow what you said in #4 above (I do have module procedures).Can you give a psuedo code example?
I am having trouble with this one library on one pc. It seems to work ok on another pc. I just can't figure out why the lib file is not being seen. It seems that objcomment has nothig to do with my problem.
Or I can give a more detailed description of the 2-3 files that are invovled, if that is easier to look at.
Many thanks.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It doesn't matter if the other library is in the same folder. The objcomment references a library filename, not a path. If the linker is not told to search a given library, it won't. OBJCOMMENT is one of many ways to tell the linker to search a library.
What is the exact error you are seeing?
What is the exact error you are seeing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Module A !is compiled into a static lib called "A.lib"& placed on the LIB path
!dec$ objcomment lib:'A.lib' ! this we decided is immaterial
Module B !is compiled into a dll
use A
B compiles and produces .lib and .exp files butgives a link2001 (unresoved external)error on ANY/ALL calls to routines in A.
If I insert objcomment lib 'A.lib' in module B it seems to go ok.
though I never recall having to do this as long as A.lib was in DF98LIB.
Thanks again for your patience.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. The objcomment in A would be seen only if the .obj created when A was compiled is pulled in when B is linked.
The location of A.lib is immaterial if nothing tells the linker to look for it. There are lots of libraries in DF98LIB that are not referenced in the typical link.
The location of A.lib is immaterial if nothing tells the linker to look for it. There are lots of libraries in DF98LIB that are not referenced in the typical link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
whoa, I assumed with command line compilation the LIB path counts for something. Is that not true??
In the example above B.dll is compiled on the commandline.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The LIB environment variable tells the linker what folders to look in when it wants to look for a library. It does not tell it which libraries to look for.

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