pybind / pybind/cuda_example

Process finished with exit code -1073741515

Open
#23 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
670
Forks
219
Avg merge
8d 2h
Merged PRs (30d)
1

Description

I'm receiving this error while tying to put together a simple pybind cmake example app.

Process finished with exit code -1073741515 (0xC0000135)

I've been google for hours now trying to figure out the source of this error. When i comment out the lines utilizing pybind (First 3 lines in main). It compiles and runs correctly and reaches the print statement. I'm pretty new to CMake so it's possible i set it up wrong. I added the lines pointing to python because I was receiving errors about missing python dll's. I'm using CLion and MSVS 2017 if that makes any difference.

example.cpp

#include <iostream>
#include <../pybind11/include/pybind11/pybind11.h>
#include <../pybind11/include/pybind11/embed.h>
#include <CImg.h>

namespace py = pybind11;
using namespace py::literals;

int main(int argc, char *argv[])
{
    py::scoped_interpreter guard{};

    auto example = py::module::import("example");
    auto resultobj = example.attr("add")(2,2);
    int result = resultobj.cast<int>();
    std::cout << result;
}

example.py

def add(a,b):
    return a+b

Cmakelists.txt:

cmake_minimum_required(VERSION 3.14)
project(TestApp)

set(CMAKE_CXX_STANDARD 11)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})

link_directories(C:\\Users\\myuser\\AppData\\Local\\Programs\\Python\\Python37-32\\libs)

add_subdirectory(lib/pybind11)
include_directories(lib/CImg-2.6.7)

add_executable(example src/example.cpp)
target_link_libraries(example PRIVATE pybind11::embed)

File Structure

TestApp
----src/
--------example.cpp
----lib/
--------Cimg-2.6.7/
--------pybind/

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/example.cpp and CMakeLists.txt, especially the pybind11 embedding setup and the Python 3.7 library path. Build and run the example on the reported Windows configuration, then identify which runtime dependency produces exit code 0xC0000135; done means the example launches and prints the result without manually commenting out the pybind11 lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.