Comments (6)
it's more than just include guards, it has to do with .cpy and how it generates code.
currently, .cpy only generates .cpp code (and no header files). we've worked on adding a way for cpy to generate .h and .cpp files, but it's not finished yet.
i recommend using QT for a better build experience: it has emulator, build guards, etc.
from rmkit.
Maybe just need some include guards?
from rmkit.
I might give Qt a shot, although what I'm doing isn't too complicated, and I appreciate how straightforward rmkit for what I'm doing (mostly just drawing on a canvas plus a couple buttons). At this point adding a separate make step to combine all my source files into one is producing pretty reasonable compile times 🤷
from rmkit.
the biggest annoyance with okp for me is inability to generate .h and .cpp files. for even relatively simple cpp (namespaces, templates, nested classes), its hard to auto generate a header file. there is makeheaders
from fossil, but it doesn't support namespace/template keywords. the best thing i've seen so far is doxygen's extractor, but it generates XML data.
the reason i want to split .h and .cpp is because i'd like compile times to significantly go down, and i'd like people to be able to include rmkit.h multiple times from multiple files.
in c++20, there is the module standard, which i think would fix my issue with generating .h and .cpp files. but in general, i don't like using new language features unless necessary.
the other route i've thought about is a new language with a formal grammar and parser, s.t. generating the header and implementation files will be possible. without an easier grammar, okp has to support arbitrary c++ which is tough to parse properly.
writing a new grammar / syntax is not something i'm really interested in, though, so i feel that waiting out the c++ module support (and adding it into okp) is reasonable
from rmkit.
i've been revisiting this. in august last year, we experimented with a "@hidden" (or "@impl") flag in okp which can be used to separate a function into its header and cpp file. Last week, I picked up development on that branch of okp and pushed it along some more. There are 3 major cases where the "@hidden" keyword was initially necessary:
- in front of headers only applicable to a .cpp file (@hidden #include "foo.h")
- on non inline/non static methods at the namespace scope
- on static variable initialization
of these, only the static variable definition is a real problem for rmkit. we can use inline
and static
to decorate functions (as mentioned in original post by mrichards42). the major additional feature added to okp was the ability to spot lines like static int foo = 1
and separate it into two pieces: one for the .h and one for the impl.
i've pushed an example of using rmkit.h in this new way to https://github.com/rmkit-dev/rmkit-cpp-example. notice that rmkit.h gets compiled to a .o file (with its impl) and then linked against the other .o files.
from rmkit.
closing out, since i think this is fixed
from rmkit.
Related Issues (20)
- [harmony] Bus error when trying to load with a different framebuffer resolution HOT 3
- Error when trying to create a build HOT 10
- [simple] Problem with diacritics HOT 10
- [total noob] can you draw monochrome / b&w images to e-ink displays? HOT 8
- [rmkit] Add font fallback support to rmkit.h HOT 2
- [remux] Remux does not seem to clear input buffers on launching another app HOT 3
- [remux] Is remux compatible with 3.8 version ? HOT 2
- Add support for Kobo Sage HOT 2
- Rename default branch to main HOT 2
- remux eats 40% of the CPU after a while on 3.8.2.1965 HOT 10
- [harmony] Kobo Elipsa 2E eraser support HOT 3
- [harmony] Export and save functions on kobo Elipsa 2E do not work HOT 8
- Remux crashes after restarting rM1 HOT 2
- [harmony] project filenames are invalid on Windows because of date formatting
- [general] Rendering regression(s) after FBInk upgrade HOT 12
- [iago] rectangle not perfectly straight
- [remux] Use SleepScreenPath setting from xochitl.conf if present
- [remux] Display personal information on suspend screen
- [bufshot] Screenshots are ~80kb
- [remux] "Corrupted" shutdown screen HOT 2
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 rmkit.