Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Get simple class dice to work in OnlineGDB C++ (Working in VS Code)?

+5 votes
asked Sep 7, 2025 by jtreacy1013 (210 points)
Have 3 programs in my project folder.  droll.cpp - Client that declares a simple 6-sided die object, rolls it 1500 time and displays the accumulated array results.

dice.h - class dice header file

dice.cpp - class dice object definition detail.

When I go to run it gives me errors.  Is there some sort of compiler option in onlineGDB that is needed to allow multiple input files in my project?  I have a #include "dice.h" in my client.

1 Answer

+2 votes
answered Sep 8, 2025 by Peter Minarik (101,340 points)
edited Sep 8, 2025 by Peter Minarik
You can share your project with the orange SHARE button.

That way, we can give you better advice on what's going on with your project specifically.

In general, all the cpp files in your project are compiled and linked automatically by OnlineGDB.

If you do not have your project on OnlineGDB, only on your local PC, can you share the build outputs so we can look at the error messages?
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...