Unexpected end of file error

前端 未结 7 1373
花落未央
花落未央 2020-12-05 09:26

I hope you can help me, cause I have no idea about what\'s going on. I\'m having the following error while trying to add Beecrypt library to my project:

相关标签:
7条回答
  • 2020-12-05 09:44

    Goto SolutionExplorer (should be already visible, if not use menu: View->SolutionExplorer).

    Find your .cxx file in the solution tree, right click on it and choose "Properties" from the popup menu. You will get window with your file's properties.

    Using tree on the left side go to the "C++/Precompiled Headers" section. On the right side of the window you'll get three properties. Set property named "Create/Use Precompiled Header" to the value of "Not Using Precompiled Headers".

    0 讨论(0)
  • 2020-12-05 09:44

    I encountered that error when I forgot to uncheck the Precompiled header from the additional options in the wizard after naming a new Win32 console application.

    Because I don't need stdafx.h library, I removed it by going to Project menu, then click Properties or [name of our project] Properties or simply press Alt + F7. On the dropdownlist beside configuration, select All Configurations. Below that, is a tree node, click Configuration Properties, then C/C++. On the right pane, select Create/Use Precompiled Header, and choose Not using Precompiled Header.

    0 讨论(0)
  • 2020-12-05 09:49

    If you do not use precompiled headers in your project, set the Create/Use Precompiled Header property of source files to Not Using Precompiled Headers. To set this compiler option, follow these steps:

    • In the Solution Explorer pane of the project, right-click the project name, and then click Properties.
    • In the left pane, click the C/C++ folder.
    • Click the Precompiled Headers node.
    • In the right pane, click Create/Use Precompiled Header, and then click Not Using Precompiled Headers.
    0 讨论(0)
  • 2020-12-05 09:50

    I also got this error, but for a .h file. The fix was to go into the file Properties (via Solution Explorer's file popup menu) and set the file type correctly. It was set to C/C++ Compiler instead of the correct C/C++ header.

    0 讨论(0)
  • 2020-12-05 09:54

    You did forget to include stdafx.h in your source (as I cannot see it your code). If you didn't, then make sure #include "stdafx.h" is the first line in your .cpp file, otherwise you will see the same error even if you've included "stdafx.h" in your source file (but not in the very beginning of the file).

    0 讨论(0)
  • 2020-12-05 09:54

    Change the Platform of your C++ project to "x64" (or whichever platform you are targeting) instead of "Win32". This can be found in Visual Studio under Build -> Configuration Manager. Find your project in the list and change the Platform column. Don't forget to do this for all solution configurations.

    0 讨论(0)
提交回复
热议问题