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

后端 未结 2 1114
说谎
说谎 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:01

    Code::Blocks has a different compiler altogether from Visual Studio, the decoding and encoding on source code during compilation is different and cannot recognize each other though they are same programming language.

    0 讨论(0)
  • 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.

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