- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am finding that sin is defined in libcmt.lib and libmmt.lib. Extract of compile line is below.
ifort -nologo -D_AMD64_-threads -O2 /Qopenmp /names:lowercase /assume:underscore -fpp -for_test.exe for_test.obj fortio.obj some_c_code.obj some_more_c_code.obj fortran_code.f mylib.lib -link -machine:amd64 -FORCE:UNRESOLVED -NODEFAULTLIB:libc.lib mkl_core.lib mkl_intel_lp64.lib mkl_intel_thread.lib mkl_blas95_lp64.lib oldnames.lib wsock32.lib libcmt.lib kernel32.lib user32.lib netapi32.lib advapi32.lib gdi32.lib comdlg32.lib comctl32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
for_test.obj : warning LNK4042: object specified more than once; extras ignored
libcmt.lib(sincos.obj) : error LNK2005: sin already defined in libmmt.lib(sin_stub.obj)
Is this a known issue? I guess I could get around it by changing all my SIN() to DSIN() in my Fortran code, but I would prefer not to. I wondered if anyone else has seen this issue? I am mixing C++ and Fortran. This is on win64 with 11.1 update 5 of the compiler and VS2005.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you attach a small source that demonstrates this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It might be tricky for me to reproduce this on a small source code unfortunately.I did remove -npdefaultlib:libc and it didnt make any difference. What is curious is that if I use /fp:precise, the problem doesgo away.
What seems to be happening is that libcmt.lib and libmmt.lib are clashing. If I remove the former from the compile line, the problem goes away.
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please let us know whether the undefined reference persists when you remove -NODEFAULTLIB:libc.lib and libcmt.lib.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
We have removed -NODEFAULTLIB:libc.lib and libcmt.lib and the multiply defined problem has gone away. So, I think the problem is solved. Thanks very much.
regards,
Tony

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