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

THEOS makefile can not link to Cephei framework #48

Open
karmamaster opened this issue Mar 26, 2021 · 3 comments
Open

THEOS makefile can not link to Cephei framework #48

karmamaster opened this issue Mar 26, 2021 · 3 comments

Comments

@karmamaster
Copy link

karmamaster commented Mar 26, 2021

Hello,
Currently I am linking one tweak and one tool with Makefile like this:

include $(THEOS)/makefiles/common.mk

TWEAK_NAME = Rebirth
TOOL_NAME = RebirthTool


CC=~/Desktop/obfuscator/build/bin/clang
CXX=~/Desktop/obfuscator/build/bin/clang++
LD=~/Desktop/obfuscator/build/bin/clang++
Rebirth_FILES = mytweakfiles
Rebirth_FRAMEWORKS = Foundation CoreFoundation MobileCoreServices UIKit CoreTelephony CoreLocation QuartzCore CoreGraphics Security
Rebirth_EXTRA_FRAMEWORKS += Cephei CepheiUI
Rebirth_LIBRARIES = substrate
Rebirth_CFLAGS = -Wno-error -Wno-module-import-in-extern-c

RebirthTool_FILES = myfiles
RebirthTool_FRAMEWORKS  = Foundation CoreFoundation MobileCoreServices UIKit CoreTelephony CoreLocation QuartzCore CoreGraphics Security
RebirthTool_EXTRA_FRAMEWORKS += Cephei CepheiUI
RebirthTool_LIBRARIES = substrate rocketbootstrap

include $(THEOS_MAKE_PATH)/tweak.mk
include $(THEOS_MAKE_PATH)/tool.mk

export GO_EASY_ON_ME = 0


after-install::
	install.exec "killall -9 SpringBoard;"

The tweak just built fine with both armv7 and arm64.
But for the tool Theos can not build it due to this error:

==> Linking tool RebirthTool (armv7)…
Undefined symbols for architecture armv7:
  "HBOutputForShellCommand(NSString*)", referenced from:
      -[processDataClass CopyFromPathToPath:] in main.mm.e878f5b2.o
      -[processDataClass protectDataOfBundle:ExceptTheseFiles:] in main.mm.e878f5b2.o
      -[processDataClass unProtectDataOfBundle:] in main.mm.e878f5b2.o
      -[processDataClass UnzipFolder:withPath:] in main.mm.e878f5b2.o
      -[processDataClass MoveZipFile:toFolder:] in main.mm.e878f5b2.o
      -[processDataClass CopyMoveZipFile:toFolder:] in main.mm.e878f5b2.o
      -[processDataClass CopyFile:toFolder:] in main.mm.e878f5b2.o
      ...
ld: symbol(s) not found for architecture armv7

I don't know why but it is linking fine with the tweak, I have double check the framework and it still there.

Please check this issue.

@kirb
Copy link
Member

kirb commented Mar 27, 2021

Can you check if the header you’re using (likely $THEOS/vendor/lib/Cephei.framework/Headers/HBOutputForShellCommand.h) has __BEGIN_DECLS and __END_DECLS? Should match this: https://github.com/hbang/libcephei/blob/33eed31d64778b9c6ba8b2d34514f29286ec71a7/HBOutputForShellCommand.h

As an alternative, if you’re not using any C++ features, you could just rename the file to main.m.

@karmamaster
Copy link
Author

I solved this by copy the HBOutputForShellCommand.h to my project and import it directly from my processDataClass.mm file. And about the HBOutputForShellCommand.h, I was checked it and it has __BEGIN_DECLS and __END_DECLS in the file. Furthermore, I see the last line is NS_ASSUME_NONNULL_END, it's just exactly as in: https://github.com/hbang/libcephei/blob/33eed31d64778b9c6ba8b2d34514f29286ec71a7/HBOutputForShellCommand.h

@Macleykun
Copy link

Believe this issue can be closed aswell.

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

3 participants