#CLion - have multiple "main" alike files & compile & run only one file in 1 project

19 messages · Page 1 of 1 (latest)

restive masonBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

viral sun
#

just have other functions and call them in main?

#

I dont know your setup

#

also you dont need headers for functions?

#
void foo()
{}

int main()
{
  foo();
}
viral sun
ruby pelicanBOT
#
Compilation successful

No output.

viral sun
#

so dont define them in another file

#

I dont know either ask your prof or give more information on how the build system works

tame mango
#

when submitting, you send 1 file - main.cpp, so keep your separate tasks in separate files

#

where is the issue

#

define task

#

that file is called a source file, typically that's main.cpp

use CLion to create separate console projects in separate folders

#

that's the way

#

do not separate your functions in headers, or other files, shove everything in main.cpp, otherwise you can't submit it

#

in real life using main.cpp only is just, bad, because compile times take too long, here we ignore that

#

I gave you the answer, create separate projects

restive masonBOT
#

@cold widget Has your question been resolved? If so, type !solved :)

#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity