Visual C++ code not working in Code::Blocks

后端 未结 2 1133
说谎
说谎 2021-01-21 17:36

I have the following code that I am currently using to call functions from a C# Dll, which works perfectly in Visual C++.

#include 
#include <         


        
2条回答
  •  梦谈多话
    2021-01-21 18:18

    Code::Blocks is a great IDE for C++ programming, but you are clearly doing Windows programming here. Though it is the same programming language, compilers are not compatible among them.

    Either if you have downloaded the CodeBlocks version with the gcc compiler, or the single CodeBlocks IDE, you need to configure CodeBlocks in order to use the MS C++ compiler. In order to do that, go to Settings >> Compiler and debugger >> Toolchain executables.

    Also, in the same option, look for Search directories and place there the path to the MS C++ compiler headers.

    Once that is done, you will be able to compile your program.

提交回复
热议问题