我在visual studio中开始了最简单的C项目,但它失败了 [英] I started the simplest of C projects in visual studio and it fails

查看:125
本文介绍了我在visual studio中开始了最简单的C项目,但它失败了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在U-tube上复制了一个例子,我所拥有的是一个包含文件和一个包含include文件的简单c文件(包含文件constains'#include< python.h>)。我复制了这个例子,据我所知,目录设置正确。



Visual Studio消息......



1> ------构建开始:项目:CProjectVS2017,配置:发布Win32 ------

1>对象引用未设置为对象的实例。

==========构建:0成功,1失败,0最新,0跳过==========



会出现什么问题?



我尝试过的事情:



没有有用的错误消息,所以我不知道该尝试什么...

I copied an example on U-tube, all i have is an include file and a simple c file which includes the include file (the include file constains '#include <python.h>). I copied the example, the directories are setup correctly as far as i can tell.

Visual Studio Message...

1>------ Build started: Project: CProjectVS2017, Configuration: Release Win32 ------
1>Object reference not set to an instance of an object.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

What could be going wrong??

What I have tried:

There are no helpfull error messages so i have no idea what to try...

推荐答案

嵌入 Python 不是最简单的 C 项目。您必须仔细按照最新教程中提供的步骤进行操作。
Embedding Python is not the simplest C project. You have to carefully follow the steps presented in a up-to-date tutorial.


可能需要编译为x64,请参阅此处的答案:c++ - 在visual studio中不能包含Python.h - Stack Overflow [ ^ ]
It could be that you need to compile as x64, see answer here: c++ - can't include Python.h in visual studio - Stack Overflow[^]


这篇关于我在visual studio中开始了最简单的C项目,但它失败了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆