"Bad CPU type in executable" with XCode

"Bad CPU type in executable" with XCode

I recently purchased the Intel compilers for OSX and just today needed to do some debugging... for which I usually use XCode on OSX. I don't actually code my application using XCode... I just load up the executable in a blank project for debugging purposes.

But it appears this doesn't work (or I'm doing something wrong) with the Intel compilers. Here is the output I get from GDB (which XCode launches):

This GDB was configured as "i386-apple-darwin".tty /dev/ttys013
Architecture of file "/Users/gastdr/projects/bison/bison-dbg" does not match user selected architecture.
Architecture of file "/Users/gastdr/projects/bison/bison-dbg" does not match user selected architecture.
warning: A handler for the OS ABI "Darwin" is not built into this configuration
of GDB.  Attempting to continue with the default i386:x86-64 settings.

sharedlibrary apply-load-rules all
(gdb) run
Running
[Switching to process 4190 local thread 0xf03]
arch: posix_spawnp: /Users/gastdr/projects/bison/bison-dbg: Bad CPU type in executable

Anyone have any ideas?

This is using version 11.0 20090131 and XCode version 3.1.2 on OSX 10.5.6

Thanks,
Derek

publicaciones de 7 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Could you run: file

to see what architecture they were built for?

Quoting - Qale (Intel)

Could you run: file

to see what architecture they were built for?

bison-opt: Mach-O 64-bit executable x86_64

Thanks!

Did you set the "Architecture" properties in the target -> info -> build tab to x86_64?

Quoting - Derek Gaston

bison-opt: Mach-O 64-bit executable x86_64

Thanks!

Could you give me the steps to loading the executable into Xcode and get the result that you saw?

Quoting - Qale (Intel)

Did you set the "Architecture" properties in the target -> info -> build tab to x86_64?

Ok - I got it. I had to set the debugger to x86_64 in the drop down box in the top left of the Debugger or Debugger Console windows.

THEN... I had to set the environment DYLD_LIBRARY_PATH environment variable (in the "Arguments" tab of the "Get Info" window for the executable) to include the stuff you usually get from sourcing iccvars.sh . Is there a standard way to do this? Is there some Framework or something I need to add to my XCode project so that it picks up these paths automatically?

Thanks,
Derek

>>>> I had to set the environment DYLD_LIBRARY_PATH environment variable (in the "Arguments" tab of the "Get Info" window for the executable) to include the stuff you usually get from sourcing iccvars.sh . Is there a standard way to do this? Is there some Framework or something I need to add to my XCode project so that it picks up these paths automatically?

Unfortunately, no. Intel compiler runtime librariescurrently are not built as frameworks. You need to set the path for DYLD_LIBRARY_PATH.

Inicie sesión para dejar un comentario.