aseprite / aseprite

Animated sprite editor & pixel art tool (Windows, macOS, Linux)
https://www.aseprite.org
28.63k stars 5.67k forks source link

Issue when compiling on macOS 10.14.4 #2074

Closed megabytesofrem closed 4 years ago

megabytesofrem commented 5 years ago

Describe your bug report or feature request here When running ninja asesprite after doing the cmake as described in the README, it errors with the following

ld: warning: object file (/Users/dhillonwilkinson/deps/skia/out/Release/libskia.a(gpu.GrCCQuadraticShader.o)) was built for newer OSX version (10.14) than being linked (10.9)
Undefined symbols for architecture x86_64:
  "is_orientation_marker(unsigned char const*, unsigned long, SkEncodedOrigin*)", referenced from:
      SkWebpCodec::MakeFromStream(std::__1::unique_ptr<SkStream, std::__1::default_delete<SkStream> >, SkCodec::Result*) in libskia.a(webp.SkWebpCodec.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Aseprite and System version

thomashempel commented 5 years ago

I have the same problem.

ryantan commented 5 years ago

Check out https://github.com/aseprite/aseprite/issues/1981

PDXChristian commented 5 years ago

I solved this by changing skia_use_system_libwebp=false to skia_use_libwebp=false. I am not sure if this is an ideal modification though, but it seems to be the way to fix it on all the Mojave devices I have tried to compile on.

andreferreirav2 commented 5 years ago

I solved this by changing skia_use_system_libwebp=false to skia_use_libwebp=false. I am not sure if this is an ideal modification though, but it seems to be the way to fix it on all the Mojave devices I have tried to compile on.

Can you tell me where you made this change? was it in the gn build command or the BUILD.gn file? The skia_use_libwebp=false already appears in the install instructions, that's what got me confused

I'm running with this:

PDXChristian commented 5 years ago

Can you tell me where you made this change? was it in the gn build command or the BUILD.gn file?

It would be in the gn build command.

The skia_use_libwebp=false already appears in the install instructions, that's what got me confused

I believe the install instructions actually specify skia_use_system_libwebp=false so if you are following the instructions, your command should look something like this:

gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_libjpeg_turbo=false skia_use_system_libpng=false skia_use_libwebp=false skia_use_system_zlib=false extra_cflags_cc=[\"-frtti\"]"

While the original in the install documentation was this:

gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false extra_cflags_cc=[\"-frtti\"]"

andreferreirav2 commented 5 years ago

I followed your instructions, ran the skia build with gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_libjpeg_turbo=false skia_use_system_libpng=false skia_use_libwebp=false skia_use_system_zlib=false extra_cflags_cc=[\"-frtti\"]"

I get this error when building aseprite:

(...)
[1518/1518] Linking CXX executable bin/aseprite
FAILED: bin/aseprite
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -stdlib=libc++ -Wall -Wno-switch -O2 -g -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.9 -Wl,-search_paths_first -Wl,-headerpad_max_install_names  src/CMakeFiles/aseprite.dir/main/main.cpp.o  -o bin/aseprite  lib/libapp-lib.a lib/libclip.a lib/libdio-lib.a lib/libfilters-lib.a lib/libflic-lib.a lib/librender-lib.a lib/libdoc-lib.a lib/libfixmath-lib.a lib/libui-lib.a lib/liblaf-os.a lib/liblaf-gfx.a lib/libpixman.a lib/liblaf-ft.a -framework Cocoa -framework Carbon /Users/andreferreira/aseprite_build/deps/skia/out/Release/libskia.a -framework opengl lib/libobs.a lib/libundo.a lib/libcmark.a lib/libjpeg.a lib/libgiflib.a lib/libwebpdemux.a lib/libwebpmux.a lib/libwebp.a lib/libfreetype.a lib/libharfbuzz.a lib/libfreetype.a lib/libharfbuzz.a lib/libpng16.a /usr/lib/libm.dylib /usr/lib/libbz2.dylib /usr/local/lib/libharfbuzz-icu.dylib lib/libjson11.a lib/libarchive.a /usr/local/lib/libnettle.dylib /usr/lib/libiconv.dylib /usr/lib/libcharset.dylib /usr/lib/libexpat.dylib lib/libfmt.a lib/libtinyexpr.a lib/liblauxlib.a lib/liblua.a lib/liblualib.a lib/libupdater-lib.a lib/libcfg-lib.a lib/libtinyxml.a lib/libnet-lib.a lib/liblaf-base.a lib/libmodpbase64.a /usr/lib/libdl.dylib lib/libcurl.a lib/libz.a -ldl -lldap && :
ld: warning: ignoring file /Users/andreferreira/aseprite_build/deps/skia/out/Release/libskia.a, file was built for archive which is not the architecture being linked (x86_64): /Users/andreferreira/aseprite_build/deps/skia/out/Release/libskia.a
Undefined symbols for architecture x86_64:
  "SkConvertPixels(SkImageInfo const&, void*, unsigned long, SkImageInfo const&, void const*, unsigned long)", referenced from:
      os::SkiaColorSpaceConversion::convertRgba(unsigned int*, unsigned int const*, int) in liblaf-os.a(skia_color_space.cpp.o)
      os::SkiaColorSpaceConversion::convertGray(unsigned char*, unsigned char const*, int) in liblaf-os.a(skia_color_space.cpp.o)
(...)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
PDXChristian commented 5 years ago

I am not totally sure what the issue is, since I do not know your entire configuration. However, I would suggest you try to completely rebuild skia since, from what I can see, it looks like there is an issue with the way skia was compiled.

pablinos commented 4 years ago

I solved this by changing skia_use_system_libwebp=false to skia_use_libwebp=false.

This fixed it for me too on Catalina. Interestingly I can't compile the master branch, only the release. I get errors about the os/paint.h file not being found. Are the instructions for compiling the master branch the same?

PDXChristian commented 4 years ago

This fixed it for me too on Catalina. Interestingly I can't compile the master branch, only the release. I get errors about the os/paint.h file not being found. Are the instructions for compiling the master branch the same?

It should be the same.

Is the error just an error with the includes for "os/paint.h" when running ninja aseprite?

If so, if you haven't already, you could try running: git pull git submodule update --init --recursive --force Then remove the contents of your build folder, and compile again.

jameynakama commented 4 years ago

I'm on OS 10.15.2 and finally found success with aseprite at current master (87c754a11) and skia at aseprite-m71. My commands were:

Skia:

gn gen out/Release --args="is_official_build=true skia_use_system_expat=false skia_use_system_icu=false skia_use_libjpeg_turbo=false skia_use_system_libpng=false skia_use_libwebp=false skia_use_system_zlib=false extra_cflags_cc=[\"-frtti\"]"

Aseprite:


cmake \                                           
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/ \
-DLAF_OS_BACKEND=skia \
-DSKIA_DIR=$HOME/deps/skia \
-DSKIA_OUT_DIR=$HOME/deps/skia/out/Release \
-G Ninja \
..
ninja aseprite```
JordanJGarcia commented 4 years ago

Had this error for a module I created and it was because I didn't have the .c file in the gcc command. Putting it in solved it. Hope this helps!