How to fix 'error trying to exec 'cc1obj': execvp: No such file or directory

6,141

You need to install the corresponding Objective-C++ cross compiler package, either from your favorite GUI package manager or via the command line using

sudo apt install gobjc++-mingw-w64

This should install both gobjc++-mingw-w64-i686 and gobjc++-mingw-w64-x86-64 allowing you to build Objective-C++ code targeting both 32-bit and 64-bit Windows platforms.

Share:
6,141

Related videos on Youtube

Dirk Swaapt
Author by

Dirk Swaapt

Updated on September 18, 2022

Comments

  • Dirk Swaapt
    Dirk Swaapt about 1 year

    I am running Ubuntu in a virtual machine and I keep getting this error when I try to execute i686-w64-mingw32-gcc -o test.dll hello.m -objc in order to cross-compile an objective c project for windows. I get the following error:

    i686-w64-mingw32-gcc: error trying to exec 'cc1obj': execvp: No such file or directory
    
    • steeldriver
      steeldriver over 6 years
      What version of Ubuntu is it, and how / from where did you install the cross-compiler toolchain? it looks like maybe a required Objective-C++ compiler component is missing?
    • Dirk Swaapt
      Dirk Swaapt over 6 years
      I'm running Ubuntu 16.04.2 LTS and I first installed gcc and after that I installed the cross-compiler toolchain mingw-w64. I also installed gobjc and gobjc++ package.
    • steeldriver
      steeldriver over 6 years
      Did you install gobjc++-mingw-w64? if not, try doing so
    • Dirk Swaapt
      Dirk Swaapt over 6 years
      It solved the error! Thanks :) Unfortunately there is now another error "fatal error: Foundation/Foundation.h: No such file or directory ", which refers to the standard foundation-header I import in my m file.
    • steeldriver
      steeldriver over 6 years
      I'd guess you'd need a full GNUStep toolchain to get that?