Skip to content

Commit a47e951

Browse files
committed
link cstdlib when linking with fortran
1 parent 4a1b68f commit a47e951

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

meson.build

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
project('Fortran_c_cxx_interface', 'c', 'cpp', 'fortran',
2-
version : '1.2.1',
3-
meson_version: '>= 0.52.0',
4-
default_options : ['default_library=static', 'warning_level=3',
5-
'cpp_std=c++11', 'c_std=c99'])
2+
version : '1.3.0',
3+
meson_version: '>= 0.55.0',
4+
default_options : ['default_library=static', 'cpp_std=c++11', 'c_std=c99'])
5+
6+
cpp = meson.get_compiler('cpp')
7+
cstdlib = cpp.find_library('stdc++', required : true)
68

79
subdir('src')

src/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ fortran_cxx_struct = executable('fortran_cxx_struct',
1616
sources: files('fortran/struct_main.f90'),
1717
include_directories: 'c',
1818
link_with: struct_cxx,
19+
dependencies: cstdlib,
1920
link_language: 'fortran'
2021
)
2122
test('Fortran C++ struct', fortran_cxx_struct, timeout: 5)

0 commit comments

Comments
 (0)