PrevUpHome

Use c++ library on Haiku - 2024-10-21-01


Use c++ library on Haiku OS

How to include, link c++ library on haiku. Dig Haiku

Prepare

Haiku OS - Haiku OS

c++ compiler - Gcc

Your favorite c++ Library, for example, your_lib, the shared library: libyour_lib.so

Editor - Kakoune

c++ code

// hello.cpp

#include <iostream>
#include <your/lib/include/path.hpp>

int main()
{
	std::cout << "Hello, c++!" << std::endl;
	use::your::lib::please;
}

Compile c++ and link libraries

g++ hello.cpp \
	-std=c++23 \
	-I ./dream/sand/include/ \
	-L./path/to/your/lib -lyour_lib \
	-Wl,-rpath,./dream/sand/lib \
	-o hello

Links

Haiku Home - Haiku OS

Back Index - Dig Haiku OS c++

cpp/c++

c++ std::exception:

std::cout.write(err.data(), err.size());

std::cout << std::endl;

caught:

  ==================================================
  #        The c++ programming language.           #
  #                                                #
  #        Home: cppfx.xyz                         #
  #        Join c++ Discord: yZcauUAUyC            #
  #        Deck                                    #
  ==================================================

PrevUpHome