Struggling with Error Code 0xc000007b in Clion for all Programs

-1

I've been trying to do a lot of research into why I am getting this error, and I see that the error essentially means a BAD_IMAGE_FORMAT when loading a 64bit SDL on a 32bit program. However I seem to be getting this error on ALL compiled executables.

Little background info: I've been messing around with SDL2 (also using SDL2_image and SDL2_ttf). When I was trying to get a simple snake game built as an .exe I started having this issue. After some research I decided to do a clean install of mingw, using 64 bit, with only 64 bit development libraries for SDL2, SDL2_image, and SDL2_ttf. After still being unable to launch the .exe because of error code 0xc000007b I decided I would go simpler, and work my way through each individual library to see if I can find where I'm going wrong. I started by using a simple "Hello World" program:

#include <iostream>
int main(int argc, char* argv[])
{
    std::cout << "Hello World" << std::endl;
    return 0;
}

with a makefile:

cmake_minimum_required(VERSION 3.9)
project(HelloWorld)
set(CMAKE_CXX_STANDARD 11)
add_executable(HelloWorld main.cpp)

which of course builds (as both debug and release) and runs with no issues in Clion. However, when running the executable that is build I still get error code 0xc000007b and my executable is unable to start. At this point I feel things were starting to get a little strange, so I decided to go with a common suggestion by running a dependency walker, and profiling my executable. It seems for everything (SDL2 program, or simple hello world program) I am getting a failure with conhost.exe. Below is the last few statements from the dependency walker.

Loaded "CLBCATQ.DLL" at address 0x00007FFFCFC50000.  Successfully hooked module.
DllMain(0x00007FFFCFC50000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "CLBCATQ.DLL" called.
DllMain(0x00007FFFCFC50000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "CLBCATQ.DLL" returned 1 (0x1).
onecore\windows\core\console\open\src\host\srvinit.cpp(411)\conhost.exe!00007FF6EA38C372: (caller: 00007FF6EA388CD9) ReturnHr(3) tid(54b4) 80070032 The request is not supported.
onecore\windows\core\console\open\src\server\devicecomm.cpp(153)\conhost.exe!00007FF6EA38A79A: (caller: 00007FFFCF553034) ReturnHr(4) tid(54b4) 800700E9 No process is on the other end of the pipe.
Exited "CONHOST.EXE" (process 0x5150) with code 0 (0x0).

So I've read some conflicting things about Conhost, I've read that it is malware but I don't think that is the case with me, because I do not see the conhost.exe running in my task manager (and that seems to be the indication that there is malware). My only clue is that the conhost is referring to "Console Window Host". So I'm really not sure what to do, since it seems I can't build any standalone executables.

Couple notes here at the end.

  1. There haven't been any other problems with other executables on my computer. (aka ones that aren't built by me using Clion)

  2. I am on a 64 bit machine (Windows).

  3. The Hello World program is running without any dlls in the folder (only the HelloWorld.exe).

  4. I am using Clion.

  5. Program is written in C++

edit: in the post I didn't add a # before include . To clear up any future confusion, I wrote the above code by hand in the post (didn't copy and paste) so if there are little errors in this post they aren't present in my actual code.

c++
windows
clion
asked on Stack Overflow Nov 22, 2018 by Raetro • edited Nov 22, 2018 by Raetro

1 Answer

-1

In C++ you should use using namespace std; and use cin, cout instead of scanf, printf(which we usually use in C)

This is the example code:

#include<iostream>
using namespace std;
int main()
{
cout << “ Hello World”;
system(“pause”);
return 0;
}

If you want to use printf or scanf in C++ you can look for the tutorial in the book Professional in C++

answered on Stack Overflow Nov 22, 2018 by Huy Lieu xuon

User contributions licensed under CC BY-SA 3.0