1,852
edits
m (→Header file) |
|||
Line 115: | Line 115: | ||
=== Compiling the code === | === Compiling the code === | ||
Generate {{Path|octave_file_io.o}} from {{Path|octave_file_io.cc}}. | |||
mkoctfile -I. -c octave_file_io.cc | |||
Generate {{Path|octave_file_io_example.exe}} from {{Path|octave_file_io_example.f90}} including {{Path|octave_file_io.o}}. | |||
mkoctfile -I. --link-stand-alone octave_file_io_example.f90 octave_file_io.o -o octave_file_io_example.exe -lgfortran | |||
If you receive errors about missing libraries, make sure your <code>LD_LIBRARY_PATH</code> is set correctly to find all Octave libraries, e.g. | |||
$ ldd ./octave_file_io_example.exe | |||
... | |||
libgfortran.so.4 => /usr/lib64/libgfortran.so.4 (0x00007fe9eb62b000) | |||
liboctinterp.so.8 => not found | |||
liboctave.so.8 => not found | |||
... | |||
Then find {{Path|liboctinterp.so.8}} and {{Path|liboctave.so.8}} on your system and type | |||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/lib/octave/{{Release}}/ | |||
[[Category:Examples]] | [[Category:Examples]] |