I'm a complete beginner at C++ and have been trying to access a C++ function from Python using a DLL through ctypes.
I always get the error AttributeError: function 'my_function' not found
when running my code.
Header.h
#pragma once
int my_function(void);
Source.cpp
#include "Header.h"
int my_function(void)
{
return(17); //test
}
ctypesTest.py
import ctypes
if __name__ == "__main__":
mydll = ctypes.CDLL("MyDLL.dll")
print(mydll.my_function())
Every time I run the Python script I get the attribute error.
I only need values out of my intended function.