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

unresolved external symbol _ISO_C_BINDING_mp_C_LOC

newfortranuser
Beginner
1,152 Views

Hi again.

I am using IVF 11.1.060. I have Composer XE, but there are some unrelated regressions already reported and blocking me from adopting it yet. I need a solution for 11.1.060 which has passed our acceptance testing.

If my main C++ application links with my Fortran static F.LIB, the C_LOC in my F.LIB works great.

But if my C++ DLL links with F.LIB, then I have a problem:

unresolved external symbol _ISO_C_BINDING_mp_C_LOC

So as suggested a few years ago in this forum by Steve Lionel, I built iso_c_binding.f90 from source and linked my C++ DLL with both my F.LIB and iso_c_binding.OBJ. The link completes without error. I have not tested runtime behavior yet.

Questions:
  1. Does this sound right?
  2. If this is the right/best solution for IVF 11.1.060?
  3. What is the earliest release of IVF in which this issue is resolved?
Thanks!



0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,152 Views
As long as you are linking to the proper Fortran run-time libraries, 11.1.060 should handle this fine. You need to make sure that ifmodintr.lib is included in the link. When you build F.LIB, did you set the property Libraries > Disable Default Library Search Rules to No? It's set to Yes by default for library projects, but when linking with C you'll want that set to No.

View solution in original post

0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,153 Views
As long as you are linking to the proper Fortran run-time libraries, 11.1.060 should handle this fine. You need to make sure that ifmodintr.lib is included in the link. When you build F.LIB, did you set the property Libraries > Disable Default Library Search Rules to No? It's set to Yes by default for library projects, but when linking with C you'll want that set to No.
0 Kudos
newfortranuser
Beginner
1,152 Views
Steve.

A thousand thanks. How silly of me. After doing five unexpectedly hard things today (unrelated to IVF!) I think I just assumed everything was going to be difficult today. You have saved me immeasurable grief.

0 Kudos
rakkota
Novice
1,152 Views
Hi, I am having the same problem (unresolved external symbol _ISO_C_BINDING_mp_C_LOC) but I am using version 10.0.025. I tried using /Zl flag but without success. I mention that I am constructing a DLL library which this code. Any advice? Thanks, Rak
newfortranuser wrote:

Hi again.

I am using IVF 11.1.060. I have Composer XE, but there are some
unrelated regressions already reported and blocking me from adopting it
yet. I need a solution for 11.1.060 which has passed our acceptance
testing.

If my main C++ application links with my Fortran static F.LIB, the C_LOC in my F.LIB works great.

But if my C++ DLL links with F.LIB, then I have a problem:

unresolved external symbol _ISO_C_BINDING_mp_C_LOC

So as suggested a few years ago in this forum by Steve Lionel, I built iso_c_binding.f90 from source and linked my C++ DLL with both my F.LIB and iso_c_binding.OBJ. The link completes without error. I have not tested runtime behavior yet.

Questions:

  1. Does this sound right?
  2. If this is the right/best solution for IVF 11.1.060?
  3. What is the earliest release of IVF in which this issue is resolved?

Thanks!

0 Kudos
Steven_L_Intel1
Employee
1,152 Views
You also need to link with ifmodintr.lib if you're not linking from Fortran and/or you specified /Zl.
0 Kudos
rakkota
Novice
1,152 Views
Thanks Steve. There is no file ifmodintr in my installation path: C:\Program Files (x86)\Intel\Compiler\Fortran\10.0.025\IA32\Lib. I did a text search in all the library files for C_LOC and I found it in libifcoremt.lib. I used this library and the linker does not complain now. Still have to test the functionality. Rak
Steve Lionel (Intel) wrote:

You also need to link with ifmodintr.lib if you're not linking from Fortran and/or you specified /Zl.

0 Kudos
Steven_L_Intel1
Employee
1,152 Views
I forget which version we moved that routine to the new library - thought it was 11.1. If you find it in libifcoremt, then use that.
0 Kudos
Reply