Mash_Casey
(Mash Casey)
1
How can I link in a core foundation framework from apple?
I have a project that includes this:
include <CoreFoundation/CoreFoundation.h>
and uses this class CFStringCreateWithCString
Im not sure how to link in core foundation frameworks please help!
Mash_Casey
(Mash Casey)
2
I’ve tried this:
executables{
envivo{
binaries.all {
cppCompiler.define ‘DEBUG’
cppCompiler.args ‘-std=c++11 -framework System/Library/Frameworks/CoreFoundation.framework’
}
}
}
Which gives me this error:
lonimac003:cpp matthew_casey$ gradle envivoExecutable main configure :compileEnvivoExecutableEnvivoCpp error: invalid value ‘c++11 -framework System/Library/Frameworks/CoreFoundation.framework’ in ‘-std=c++11 -framework System/Library/Frameworks/CoreFoundation.framework’ :compileEnvivoExecutableEnvivoCpp FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:compileEnvivoExecutableEnvivoCpp’. > C++ compiler failed; see the error output for details.
Mash_Casey
(Mash Casey)
3
OK I found the solution, i needed to specify it as a linker argument not a compiler argument:
executables{
envivo{
binaries.all {
cppCompiler.define ‘DEBUG’
cppCompiler.args ‘-std=c++11’
linker.args ‘-framework’, ‘CoreFoundation’
}
}
}