cmakefilesambadevkitpro

Installing and using and Header files in C, namely bdsm.h


I'd like to access an smb share through my WiiU (using an app of my making) instead of just moving and playing around with the local file system.

After much searching, I found bdsm (don't search for this on Google with people nearby), and I tried using it. But my program (the smallest example I can make):

#include <bdsm.h>

int main(int argc, char** argv)
{
    smb_session   *session;
    session = smb_session_new();
}

Throws this error: undefined reference to `smb_session_new'

I have the header files in the correct location (as I have no message of file not found), but I can't understand why this error appears.

My question is mostly about the usage of header files, as the book I read about C is for absolute beginners and "just" teaches data types, file system access to files and memory allocations, not usage of headers.

Is there any preparatory work I need to do before using this specific library? Or libraries, for that matter? I go towards the pages of some libraries, but for someone who is starting on his own, it's really hard to make heads or tails of the instructions, as they mostly use commands that make use of the users' knowledge.

Also, the only thing I have installed is devKitPro, and have been able to run my app on the WiiU using basic text and file system access, but those didn't require any "new" library..

The CMakeLists.txt is this:

cmake_minimum_required(VERSION 3.2)
set(CMAKE_TOOLCHAIN_FILE $ENV{DEVKITPRO}/wut/share/wut.toolchain.cmake)

project(helloworld C)
include("${DEVKITPRO}/wut/share/wut.cmake" REQUIRED)

add_executable(helloworld
    main.c)

target_compile_options(helloworld PRIVATE -Wall)

wut_create_rpx(helloworld)

So, how can I list the files on my Raspberry Pi that is configured with Samba using this library?

Thank you.


Solution

  • Well, after banging my head against the internet, the documentation, the library website....

    They changed the build system to meson: https://github.com/videolabs/libdsm/issues/169.

    Found it after looking at the closed issues and having seen the very first comment about the compiling instructions.

    after looking around, I finaly built it. Now to actually use it...