- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have used a static library in a DLL project. Both done in msdev.
If I compile BOTH the dll and the Static lib with /libdir:noauto There are no errors.
The same seems to be true of NEITHER has the option /libdir:noauto
(though somehow I am suspicious of this observation)
If EITHER the static Lib or the DLL is done w/ /libdir:noauto but not the other one, I get the
famous:
LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Since there are two config's which seem to go without errors I suppose I have no problems (one hopes).
My MAIN usage is when the DLL is compiled using the cmd line using:
df.exe /check:bounds /arch:host /libdir:noauto /warn:all /traceback /dll /libs:dll [filename]
Results in a dozen errors of conflicts between dfor vs dfordll, and libc vs msvcrt, e.g.:
dfor.lib(for_vm.obj) : error LNK2005: _for_alloc_allocatable already defined in dfordll.lib(DFORRT.DLL)
libc.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrt.lib(MSVCRT.dll)
...
Of course I'd like to know what combination of settings is appropriate for
either the cmd line or msdev, But it would be nice to know what the heck is going on too.
Everytime I come across this annoying problem, read Stevo's write-up on this
but every time I find it not illuminating to dimmies like myself. In particular I cannot tell what lib is needed and how to select or deselect them.
Up to now I could get away with setting /libdir:noauto but apparently not this time.
I'd appreciate any ideas.
Dim Tim
If I compile BOTH the dll and the Static lib with /libdir:noauto There are no errors.
The same seems to be true of NEITHER has the option /libdir:noauto
(though somehow I am suspicious of this observation)
If EITHER the static Lib or the DLL is done w/ /libdir:noauto but not the other one, I get the
famous:
LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Since there are two config's which seem to go without errors I suppose I have no problems (one hopes).
My MAIN usage is when the DLL is compiled using the cmd line using:
df.exe /check:bounds /arch:host /libdir:noauto /warn:all /traceback /dll /libs:dll [filename]
Results in a dozen errors of conflicts between dfor vs dfordll, and libc vs msvcrt, e.g.:
dfor.lib(for_vm.obj) : error LNK2005: _for_alloc_allocatable already defined in dfordll.lib(DFORRT.DLL)
libc.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrt.lib(MSVCRT.dll)
...
Of course I'd like to know what combination of settings is appropriate for
either the cmd line or msdev, But it would be nice to know what the heck is going on too.
Everytime I come across this annoying problem, read Stevo's write-up on this
but every time I find it not illuminating to dimmies like myself. In particular I cannot tell what lib is needed and how to select or deselect them.
Up to now I could get away with setting /libdir:noauto but apparently not this time.
I'd appreciate any ideas.
Dim Tim
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not my writeup.... The original MCLS article was written by Lorri Menard, the follow-up by Peter Karam.
There is a nice chart in the first article that shows the different library combinations. You have to make sure that every build using your code, either that of the library itself or the program that uses the library, specifies the same (or compatible) settings for which set of libraries to use: static vs. DLL, threaded vs. non-threaded, debug vs. non-debug.
Steve
There is a nice chart in the first article that shows the different library combinations. You have to make sure that every build using your code, either that of the library itself or the program that uses the library, specifies the same (or compatible) settings for which set of libraries to use: static vs. DLL, threaded vs. non-threaded, debug vs. non-debug.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Where can I find this "first article"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://compaq.com/fortran/visual/newsletter.html First article is in issue 6, second in issue 10.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This MCLS material from Lorri's article was added to the CVF Prog. Guide (PG) around 6.5. In the online doc's, see Prog. Guide> Building Programs and Libraries > Defining Your Project > Specifying Consistent Librray Types.
In the CVF PG on the web, look in it Section 2.3.4 at http://h18009.www1.hp.com/fortran/docs/vf-html/vf_frame.htm
In the CVF PG on the web, look in it Section 2.3.4 at http://h18009.www1.hp.com/fortran/docs/vf-html/vf_frame.htm

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