Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Projects with multiple cpp2 files #1344

Unanswered
AdRiley asked this question in Q&A
Nov 29, 2024 · 1 comments · 4 replies
Discussion options

Sorry this is a newbie question, but what is the correct way of splitting a project across multiple .cpp2 files?

Say I have this code

main: () =
{
Hello();
}

Hello : () =
{
std::cout << "Hello World";
}

And want to move the definition of Hello into a different file?

You must be logged in to vote

Replies: 1 comment 4 replies

Comment options

I think this is a subject of #594.

You must be logged in to vote
4 replies
Comment options

Yes I read that one, but it seems more about using headers to work alongside cpp code. What do I do in a pure ccp2 project?

Comment options

You still need Cpp2 headers, unless you're OK with forward-declaring Hello in Cpp1.

Comment options

I think for pure cpp2 projects we should push towards using modules exclusively, but cppfront doesn't support that (yet) #269

Comment options

I'm doing a multiple-cpp2 project right now and using Johel's modules version of cppfront. It's working pretty well. https://github.com/threeifbyair/advent2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /