- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did:
program test
use, intrinsic :: iso_c_binding
implicit none
type(c_ptr) :: it
it=C_NULL_PTR
end program test
gives on compilation:
Undefined symbols:
"_iso_c_binding_mp_c_null_ptr_", referenced from:
_MAIN__ in ifortSi2yr6.o
on MAC OS 10.5.2 with ifort 10.1
program test
use, intrinsic :: iso_c_binding
implicit none
type(c_ptr) :: it
it=C_NULL_PTR
end program test
gives on compilation:
Undefined symbols:
"_iso_c_binding_mp_c_null_ptr_", referenced from:
_MAIN__ in ifortSi2yr6.o
on MAC OS 10.5.2 with ifort 10.1
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a known problem that is fixed in a future release. I think you can work around it with something like this:
module my_iso_c_binding
use, intrinsic :: iso_c_binding, dummy=>C_NULL_PTR
type(c_ptr) :: C_NULL_PTR
!DEC$ ATTRIBUTES EXTERN,ALIAS:"iso_c_binding_mp_c_null_ptr" :: C_NULL_PTR
end module my_iso_c_binding
program test
use my_iso_c_binding
implicit none
type(c_ptr) :: it
it=C_NULL_PTR
end program test
module my_iso_c_binding
use, intrinsic :: iso_c_binding, dummy=>C_NULL_PTR
type(c_ptr) :: C_NULL_PTR
!DEC$ ATTRIBUTES EXTERN,ALIAS:"iso_c_binding_mp_c_null_ptr" :: C_NULL_PTR
end module my_iso_c_binding
program test
use my_iso_c_binding
implicit none
type(c_ptr) :: it
it=C_NULL_PTR
end program test
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I copy pasted your code but it still doesn't compile:
Undefined symbols:
"iso_c_binding_mp_c_null_ptr", referenced from:
_MAIN__ in ifortFw4qcO.o
ld: symbol(s) not found
Undefined symbols:
"iso_c_binding_mp_c_null_ptr", referenced from:
_MAIN__ in ifortFw4qcO.o
ld: symbol(s) not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oops. Use this instead:
!DEC$ ATTRIBUTES EXTERN,ALIAS:"iso_c_binding_mp_c_null_ptr_" :: C_NULL_PTR
I never can keep the different name decorations straight. The problem is that we fixed a bug in the compiler that left off a leading underscore but missed updating the run-time library.
!DEC$ ATTRIBUTES EXTERN,ALIAS:"iso_c_binding_mp_c_null_ptr_" :: C_NULL_PTR
I never can keep the different name decorations straight. The problem is that we fixed a bug in the compiler that left off a leading underscore but missed updating the run-time library.

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