Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process finished with exit code -1073741515 #23

Open
vpaladino778 opened this issue Jul 10, 2019 · 0 comments
Open

Process finished with exit code -1073741515 #23

vpaladino778 opened this issue Jul 10, 2019 · 0 comments

Comments

@vpaladino778
Copy link

vpaladino778 commented Jul 10, 2019

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant