0

I'm having a similar problem with this person. https://developer.apple.com/forums/thread/674635

I believe I'm having header problems after my macos update. After updating my macOS (did it quite late) something didn't work with my C code which worked perfectly before the update. I don't know whether it matters but I also deleted the Xcode App. Compiling using Makefile worked well but after the below command in my VScode terminal I got this.

./mp1_20221234 input00001.txt 1

./mp1_20221234
input00001.txt
1
4 5
1 2 -1 -4 -20 
-8 -3 4 2 1 
3 8 10 1 3 
-4 -1 1 7 -6 
ofp open error.
zsh: segmentation fault  ./mp1_20221234 input00001.txt 1

which is confusing because the code worked just fine before. I suspect its a header problem because the VS code editor indicates red lines under

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

and I tried the codes under a different environment and it worked just good.

Below are the things I've tried to do.

I've tried uninstalling and reinstalling XCode. How to update Xcode from command line

I tried installing Command line tools for Xcode 14.1 beta3 from https://developer.apple.com/download/all/?q=xcode since the old version didn't work because my macOS version was too new. trying to install install Xcode version 11

After googling I tried to use the package

/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

but I didn't have the Packages https://developer.apple.com/documentation/xcode-release-notes/xcode-10-release-notes Said this package will no longer be provided

I tried following the solution https://developer.apple.com/forums/thread/122762 and found the header files are in

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

but couldn't do

-isysroot $(xcrun --show-sdk-path) -I/usr/include -L/usr/lib

I've tried https://youtu.be/b2Ms6v8kRv4 this video but couldn't understand from the middle....

Anyone who can answer will be great help 아무나 도와주시면 감사하겠습니다 ㅠㅠ

김은우
  • 1
  • 2

0 Answers0