Comments (10)
You should add Sourcode/include/mx
to your project, not Sourcecode/private/mx/api
.
from mx.
hank you, I fixed it.
I try "#import "mx/api/ApiCommon.h"" . also error when compile.
This is my xcode configuration for c++
from mx.
Now I think you're back to the problem where headers are being interpreted as C instead of C++.
Are you including an mx file from a .m file, a .mm file, or something else?
from mx.
Now I think you're back to the problem where headers are being interpreted as C instead of C++.
Are you including an mx file from a .m file, a .mm file, or something else?
#import "mx/api/ApiCommon.h" in a .mm file.
from mx.
Hmmm, ultimately what you are trying to do is use C++ code in an iOS project, which is a fairly common thing to do.
Xcode build settings are very complicated, and without access to the project it's going to be difficult to help you set it up. Maybe there's an issue with header search paths? Maybe your .mm file is being interpreted as Objective-C instead of C++?
Maybe I can try to set up an example iOS project, but it's not my area of expertise. I think I would probably do one of these things.
-
add the mx source code to my iOS project directly, or
-
add the existing mx Xcode project into my project and depend on its iOS framework target, or
-
build the iOS.framework target from the checked-in Xcode project, then add that and the headers to the iOS project.
Option 3 is what we did when we were working on the Komp iOS project. We chose option 3 because mx takes a while to compile and we didn't want to have to recompile frequently.
Option 1 seems like the simplest to me. Both Option 1 and 2 avoid the possibility of not having the right architecture compiled (when using the simulator, for example). Option 1 avoids having any dependency on someone else's complicated Xcode settings.
from mx.
Thank you very much for spending time on my question.
Another way is to support'cocoapods'. Is it currently possible?
from mx.
I have not published anything on cocoapods.
Attached is a project that may help you. I will explain in the next message.
from mx.
- To create this project, I copied
mx/Sourcecode
into the ios project and renamed itmx-sourcecode
. - I deleted these, they are not needed:
Sourcecode/private/mxtest
Sourcecode/private/mx/examples
- I added the mx-sourcecode to the Xcode iOS project.
My header and C++ settings look like this:
- I created a function named getXml() using a
.mm
file, but exporting it asextern "C"
Swift cannot interact with C++, only with C.
- I added that header to the
mxios-Bridging-Header.h
which made it available in Swift.
- I called it in a swift file
- It worked
from mx.
It would certainly be easier if you could find a Swift implementation of MusicXML. With C++ you will have to write C functions and Objective-C classes to bridge between Swift and the C++ layer. I hope this helps!
from mx.
Thank you very much for your guidance, but I am still a bit new to the C language. I will use it in my project as you demonstrate. Thanks again, I hope to support cocoapods soon
from mx.
Related Issues (20)
- Revive DocumentManagerTest.cpp
- Fix AppearanceData TODO in LayoutFunctions.cpp
- MeasureNumbering might be dead code
- api: support transpose element HOT 9
- How exactly am I supposed to setup and use mx in a project? HOT 2
- build-with-apple.sh is broken because ios simulator architectures have changed HOT 3
- in Xcode LLVM C++ standard library with c++11 support HOT 3
- PathRoot.h not found with Xcode MXTest Project HOT 3
- Help building the library HOT 2
- Timing information of individual notes ? HOT 1
- Expand repeats ? HOT 1
- Implement segno reading HOT 2
- Add reading and writing of arpeggiate HOT 2
- Question about ordering of starts and stops for e.g. slurs HOT 2
- Any Benchmark on musicxml parsing?
- NonTraditional key : C key HOT 6
- Use RAII for the DocumentManager
- Add Encoding Supports Hints to ScoreData
- Use the typesystem to help with Tenths
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mx.