Trying to use the blog function in obs plugin in vs2022 (beginner to obs plugin dev)

AndersBillLinden

New Member
Here is what I tried:
* Start vs2022
* Click File -> new project
* Select Dynamic-Link Library (DLL) C++ project with any name
* Copy libobs and libobs-winnt folders from https://github.com/obsproject/obs-studio into project dir using windows explorer
* Right click project in Solution Explorer, click properties and in Configuration Properties -> Include Directories append ;libobs;libobs-winnt
* First "Show All Files" in solution explorer so I see the folder structure, then right click the libobs folder and "Include in project"
* In visual studio add to dllmain.cpp so it reads:

Code:
#include "pch.h"

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

__declspec(dllexport) bool obs_module_load(void)
{
    blog(LOG_INFO, "plugin loaded successfully");
    return true;
}
Both blog and LOG_INFO are missing here.
Why?
 

AndersBillLinden

New Member
C:\project\obs_plugin>cmake CMakeLists.txt
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
-- The C compiler identification is MSVC 19.34.31933.0
-- The CXX compiler identification is MSVC 19.34.31933.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:24 (find_package):
By not providing "Findlibobs.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "libobs", but
CMake did not find one.

Could not find a package configuration file provided by "libobs" with any
of the following names:

libobsConfig.cmake
libobs-config.cmake

Add the installation prefix of "libobs" to CMAKE_PREFIX_PATH or set
"libobs_DIR" to a directory containing one of the above files. If "libobs"
provides a separate development package or SDK, be sure it has been
installed.


-- Configuring incomplete, errors occurred!
See also "C:/project/obs_plugin/CMakeFiles/CMakeOutput.log".

C:\project\obs_plugin>
 
Last edited:
Top