jhford / screenresolution

Command line utility for getting, setting and listing display resolution on Mac OS X 10.6+
Other
357 stars 67 forks source link

make dmg throws error #29

Closed mehulmpt closed 6 years ago

mehulmpt commented 6 years ago

My model: MacBook Air Early 2015 Version 10.13.2 When I do make dmg after cloning the repo and cd-ing into it, it throws the following output:

dev@mehulmpt:~/screenresolution$ make dmg
sed -e "s/@VERSION@/\"1.7dev\"/" < version-tmpl.h > version.h
clang   -arch i386 -arch x86_64 main.c -c -o main.o
main.c:175:26: warning: implicit declaration of function 'MIN' is invalid in C99
      [-Wimplicit-function-declaration]
        idxDisplayMode = MIN(idxDisplayMode, numModes - 1);
                         ^
1 warning generated.
main.c:175:26: warning: implicit declaration of function 'MIN' is invalid in C99
      [-Wimplicit-function-declaration]
        idxDisplayMode = MIN(idxDisplayMode, numModes - 1);
                         ^
1 warning generated.
clang   -arch i386 -arch x86_64 cg_utils.c -c -o cg_utils.o
cg_utils.c:25:30: warning: 'CGDisplayModeCopyPixelEncoding' is deprecated: first
      deprecated in macOS 10.11 [-Wdeprecated-declarations]
        CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(mode);
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:176:34: note: 
      'CGDisplayModeCopyPixelEncoding' has been explicitly marked deprecated
      here
CG_EXTERN CFStringRef __nullable CGDisplayModeCopyPixelEncoding(
                                 ^
1 warning generated.
cg_utils.c:25:30: warning: 'CGDisplayModeCopyPixelEncoding' is deprecated: first
      deprecated in macOS 10.11 [-Wdeprecated-declarations]
        CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(mode);
                                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:176:34: note: 
      'CGDisplayModeCopyPixelEncoding' has been explicitly marked deprecated
      here
CG_EXTERN CFStringRef __nullable CGDisplayModeCopyPixelEncoding(
                                 ^
1 warning generated.
clang   -arch i386 -arch x86_64 -framework Foundation -framework ApplicationServices main.o cg_utils.o -o screenresolution
Undefined symbols for architecture i386:
  "_MIN", referenced from:
      _listAvailableModes in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [screenresolution] Error 1

Subsequent calls to make dmg throw the following errors:

dev@mehulmpt:~/screenresolution$ make dmg
clang   -arch i386 -arch x86_64 -framework Foundation -framework ApplicationServices main.o cg_utils.o -o screenresolution
Undefined symbols for architecture i386:
  "_MIN", referenced from:
      _listAvailableModes in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [screenresolution] Error 1

What should I do?

mehulmpt commented 6 years ago

Fixed this by adding:

#ifndef MIN
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define VERSION "1.7dev"
#endif

to version.h file