Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUCE 7 causing "Undefined symbols for architecture x86_64" #742

Closed
jdh9862 opened this issue Aug 6, 2022 · 8 comments
Closed

JUCE 7 causing "Undefined symbols for architecture x86_64" #742

jdh9862 opened this issue Aug 6, 2022 · 8 comments

Comments

@jdh9862
Copy link

jdh9862 commented Aug 6, 2022

I recently updated to JUCE 7, and began getting this error when I try to build with CLion using CMake

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_MTLTextureDescriptor", referenced from:
      objc-class-ref in libBasic.a(include_juce_gui_basics.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

From a little digging, I think something is up with how FRUT is generating the CMake file. I am still able to build/run my code with Xcode using Projucer.

@McMartin
Copy link
Owner

McMartin commented Aug 6, 2022

@jdh9862 thanks for using FRUT!

Basic support for JUCE 7 was added in #724, which was merged 19 days ago. Which commit of FRUT are you using?

@jdh9862
Copy link
Author

jdh9862 commented Aug 6, 2022

I am at the head of main. I see the commit you are referring to, but I am still experiencing this issue. I have tried deleting CMakeLists.txt and cmake-build-debug to try to get a clean build, but the error is persisting.

@McMartin
Copy link
Owner

McMartin commented Aug 6, 2022

@jdh9862 Could you please add these two lines to your CMakeLists.txt file (after the line that contains include(Reprojucer)):

file(SHA1 "${Reprojucer.cmake_DIR}/Reprojucer.cmake" reprojucer_hash)
message(STATUS "${reprojucer_hash}  ${Reprojucer.cmake_DIR}/Reprojucer.cmake")

and tell me what gets printed when you configure your project?
Thanks!

@jdh9862
Copy link
Author

jdh9862 commented Aug 8, 2022

-- Reprojucer.cmake's hash is: 5ac16e71c903c33f9331c81d8910728d7112d0d0

@McMartin
Copy link
Owner

McMartin commented Aug 8, 2022

@jdh9862 I'm sorry, I edited my previous comment and changed the second line to add. Could you please edit your CMakeLists.txt to match and give me the output?

@jdh9862
Copy link
Author

jdh9862 commented Aug 8, 2022

-- 5ac16e71c903c33f9331c81d8910728d7112d0d0 /Users/jameshindal/FRUT/prefix/FRUT/cmake/Reprojucer.cmake

@McMartin
Copy link
Owner

McMartin commented Aug 8, 2022

@jdh9862 FRUT/prefix/FRUT/cmake/Reprojucer.cmake was copied from FRUT/cmake/Reprojucer.cmake when you ran cmake --build . --target install inside of FRUT/build. The files under FRUT/prefix don't get updated by checking out a different commit.

You either need to:

  • update all the files that are located under FRUT/prefix by running:

    cd FRUT/build
    cmake --build . --target install
    
  • use FRUT/cmake/Reprojucer.cmake in your CMakeLists.txt by changing the line that appends to CMAKE_MODULE_PATH:

    -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../FRUT/prefix/FRUT/cmake")
    +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../FRUT/cmake")
     include(Reprojucer)

@jdh9862
Copy link
Author

jdh9862 commented Aug 8, 2022

That fixed everything, thank you :)

@McMartin McMartin closed this as completed Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants