简体   繁体   English

在Visual C ++中使用makefile构建hello_world时遇到问题

[英]Trouble building hello_world with a makefile in Visual C++

I am following this tutorial on making a hello_world program with Visual C++ 2010 express. 我正在按照本教程讲解如何使用Visual C ++ 2010 express创建hello_world程序。 My hope in doing this is to get comfy with VC++ and eventually build a hello_world program that I can actually utilize on my handheld DS, but I am stuck at an early stage. 我希望这样做是为了使自己对VC ++感到满意,并最终构建一个hello_world程序,我可以在手持式DS上实际使用它,但是我仍处于早期阶段。 I am able to follow all instructions in the tutorial and achieve the correct results until I reach the bit titled "compile project". 我可以按照本教程中的所有说明进行操作,并获得正确的结果,直到到达标题为“编译项目”为止。

When I click build hello_world, as it says to do in the tutorial, I receive this error from VC++ : 当单击构建hello_world时(如本教程所述),我从VC ++收到此错误:

1>------ Build started: Project: hello_world, Configuration: Debug Win32 ------
1>  make: *** No targets specified and no makefile found.  Stop.
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error     MSB3073: The command "make" exited with code 2.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have tried going into the hello_world properties, configuration properties, NMake and changing the 'include search path' to the directory containing the Makefile, which also contains the source folder for hello_world, but I get the same build error. 我尝试进入hello_world属性,配置属性,NMake,并将“包含搜索路径”更改为包含Makefile的目录,该文件也包含hello_world的源文件夹,但出现相同的构建错误。 Please note: I am quite new to VC++ and programming in general, so I would not be surprised if this is not doing what I think it is doing. 请注意:我对VC ++和编程一般还是很陌生,所以如果这没有按照我的想法做,我不会感到惊讶。 I think it's changing the directory that VC++ looks in to find the make file, but please let me know if I am incorrect. 我认为它正在更改VC ++查找的目录以查找make文件,但是如果我不正确,请告诉我。

Other configuration properties include the following: 其他配置属性包括:

  1. Output directory: $(SolutionDir)$(Configuration)\\ 输出目录:$(SolutionDir)$(Configuration)\\
  2. Intermediate directory: $(Configuration)\\ 中间目录:$(Configuration)\\
    • (Does this have anything to do with my problem? What is this?) (这与我的问题有关系吗?这是什么?)

My current hello_world project in the solution explorer includes the main.cpp in the Source files folder and the Makefile. 解决方案资源管理器中我当前的hello_world项目在Source files文件夹和Makefile中包含main.cpp。

I am doing this to learn, so if it seems like there is anything I am really misunderstanding, I would very much appreciate a bit of education on your part, or a link to a good resource for learning. 我这样做是为了学习,因此,如果它好像有什么事我真的误会,我非常感谢你的一位教育,或者一个良好的学习资源的链接。 Also, I am having a bit of trouble conceptualizing everything that is going on with projects, solutions, source files, building, etc within visual C++ and the provided tutorials from Msoft have helped my ability to use VC++, but not really understand what I'm doing. 另外,我在概念化视觉C ++中项目,解决方案,源文件,构建等过程中遇到的一切时遇到了一些麻烦,Msoft提供的教程帮助了我使用VC ++的能力,但并不能真正理解我的意思。我在做。 Does anyone know of a guide that might help me learn why I do certain things that I've been taught to do in visual c++? 有谁知道一个指南可以帮助我学习为什么我要做一些我在视觉c ++中被教导要做的事情?

Let me know if there is more information that I need to include! 让我知道是否需要提供更多信息!

Welp, I just deleted all of the project files and folders and retried the tutorial, making sure to follow directions more carefully. 抱歉,我只是删除了所有项目文件和文件夹,然后重试了本教程,确保更仔细地按照说明进行操作。 I must have missed something the first time through, because it has now completed its build successfully. 我一定是第一次错过了一些东西,因为它现在已经成功完成了构建。 I don't think it was the path because I didn't change anything about that. 我不认为这是一条路,因为我对此没有做任何改变。 The only thing I know I changed for sure was the output to hello_world.nds rather than hello_world.exe. 我唯一确定要更改的是输出到hello_world.nds而不是hello_world.exe。 I imagine that might have caused some issues, but maybe not. 我想这可能引起了一些问题,但也许没有。 I'd still love links to any resources that might be able to excel my Visual C++ learning! 我仍然希望链接到任何可能精通Visual C ++学习的资源!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM