Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Important Update: Community Platform Migration​. Learn more​>

Yet Another LNK4098 posting!

rahzan
New Contributor I
1,374 Views
I have a DLL which compiles fine under SingleTreadedDLL libraries. I have just added a c-wrapper to it for execption handling.

If I have /libdir:noauto I get:
"defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library"

WITHOUT /libdir:noauto I get the same complaint but on LIBCMT.
(presumably a C-multithreaded library?)

The same things happens with: MultiTreadedDLL under the Fortran|Libraries Tab.

I'd appreciate any hints.
Tim

in case it is relevant: The DLL also links in a static CVF library which is ALSO compiled using SingleTreadedDLL. Without the c-wrapper the static library never presented any problems.
0 Kudos
5 Replies
rahzan
New Contributor I
1,374 Views
The warning goes away when I set the Runtime Library under the project's C-tab to MultiThreaded DLL.

Prior to this, I had thought to set the C-libraries to conform to the fortran libraries, but the fact the C-tab did not have the parallel "Libraries" as the FOtran Tab threw me off before.

Now the problem is I do not know what should be set for the fortran libraries. There are FOUR choices, all of which compile:

Fortran Library: MultiThreadDLL vs SingleThreadDLL
Fortran: /libdir:auto vs /libdir:noauto

I cannot decide what the appropriate settings are because:
I figure due to the fact the the C-libs are MultiThread so should the F90 libs, but will that cause speed degradations or other overhead?

And I truly still do not understand the /libdir option.

In the end ,I will be happy if someone can declare what the right settings should be.

thanks, Tim
0 Kudos
Steven_L_Intel1
Employee
1,374 Views
Read the article on MCLS in the CVF newsletter issue 10. It explains this better than I could.

/libdir means "library directives". The compiler inserts linker directives in the object modules to pull in appropriate Fortran libraries, depending on the /libs setting you use. /libdir:noauto says to ignore these "automatic" library directives.

Steve
0 Kudos
rahzan
New Contributor I
1,374 Views
Thanks Steve,
I realize the notion od inserting directives, but what the docs do not explain is what are the consequences of each setup?

Under what circumstance would one NOT want the compiler insert the necessary directives in the Obj file?

If one does select /libdir:noauto how else will the program find the libraries it needs?

If all this applies to OBJ files does the /libdir have any consequence for a LIB, DLL, or EXE project?

I hope to see the answers in the article you point to, if I can find it.

FINALLY, any ideas on how to select MultThread vs SingleThread in this situation?

Tim
0 Kudos
Steven_L_Intel1
Employee
1,374 Views
You would not want the compiler to insert the directives if you were creating a static library to be used by others. Then you wouldn't have to build different variants of the library for the different library combinations.

Note that for C, you might have to do this, because choosing the threaded libraries actually changes the compiled code. Not for CVF.

It is true that MSVC does not have all of CVF's combinations. But you want to select a combo that matches.

Steve
0 Kudos
rahzan
New Contributor I
1,374 Views
Thanks,
One more question:
Howzitdat msc aingot no SingleThread DLL option?

Tim
0 Kudos
Reply