Mingw - application unable to start

Hi
im using mingw and im trying to link with glew

the problem is that after compilation when i try to run the binary
it gives me the following error:
 
The application was unable to start correctly (0xc000007b).


This is my makefile:
1
2
3
4
5
6
7
8
9
10
11
CXX = g++
CXXFLAGS = -Wall -std=c++11 -I./include -m64
LIBS = -I./libs/glew-2.1.0/include/ -L./libs/glew-2.1.0/lib/Release/x64 -lglew32

default:
	$(CXX) $(CXXFLAGS) ./src/*.cpp $(LIBS) -o ./bin/a.exe

run: 
	@./bin/a.out

 */


the src dir just contains a main.cpp that just prints "hello world"
so that shouldnt be the problem.

From searching around on google it looks like im missing a dependency but i already copied glew32.dll to the same directory as my outputted binary file so im not sure what else i could be missing?

can somebody please help me?
I see you are manually trying to have it build in 64-bit with the -m64 option. I have never used this... but a common problem that could cause your error is that a 64-bit DLL is trying to be loaded into a 32-bit process.

Three things, if you would:
- Determine if the .exe output is 32-bit or 64-bit. You can do that by following the directions here: https://superuser.com/a/889267 Let us know what the result is.
- Can you add verbose to your build script by adding -v to your CXXFLAGS, and then post the output?
- Since it compiles fine, can you open your .exe file with the Dependency Walker?
http://www.dependencywalker.com/

One more note, I just realized:
A lot of "pre-built" binaries from websites like to pretend that Windows == Visual Studio, and that other ways to compile programs don't exist.

I'm not sure if your glew32.lib is compatible with MinGW. Maybe this link helps https://stackoverflow.com/questions/7241047/linking-lib-files-with-mingw

You might have to build glew32 yourself!


Edit: Gonna try compiling myself with g++ to see what happens.
Edit 2: Okay I stopped trying. Since you figured it out, bump the topic if you have more questions.
In general, I always just build everything myself, usually with MSYS2. Getting libraries like FFTW3 to build without MSYS2 is a PITA.
Last edited on
ah i figured it out, i was just being stupid.
After downloading dependency walker and inspecting my .exe i noticed that the glew32 dll wasn't 64 bit

i guess i must have accidentally copied from the wrong glew directory (pretty annoying that they are both called glew32)

its all working now

thanks for the help
Last edited on
Topic archived. No new replies allowed.