Can't compile/debug x32 Code on x64 macOS System (C)

0

I really hope some of you are able to help me.

I am new to macOS. MacBook Pro Retina (2014) with macOS Mojave 10.14.4 installed. I installed Homebrew, Xcode, gcc, gdb, because I want to code in C. My programs work fine. There are no errors in it. When I compile them with: gcc -o file file.c I can use my programs and I see warnings, when there are some errors in my code. So everything is fine with that. But then I tried to use gdb for debugging. But when I try to run a file, I get this error:

file p2 BFD: /Users/admin/Documents/SysPro/P2/p2: unknown load command 0x32 BFD: /Users/admin/Documents/SysPro/P2/p2: unknown load command 0x32 "/Users/admin/Documents/SysPro/P2/p2": not in executable format: file format not recognized

also when I type in -g instead of the -o when using gcc I get a similar error: can't link with a main executable file 'p2' for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am looking for 2 days for a solution... but I can't find any help. I understand the problem. It's the architecture that's bothering the compiler/debugger. It can't deal with a 64bit System and 32bit files. With research I found out that this is a common problem on macOS and it came with an Update.

I'm really desperate and I hope some of you are able to help me.

Thank you for your time :-)

AIRAW

Posted 2019-03-28T18:19:56.223

Reputation: 1

No answers