Author Topic: C and C++ files in the project  (Read 990 times)

Bwana The Bigg

  • Community Member
  • Posts: 13
  • Hero Points: 0
C and C++ files in the project
« on: March 07, 2025, 09:35:25 AM »
Hello!
I have a project, some of the source files are in C, some in C++. For compilation, I set "CC" in the "Build:GNU C Options:Compiler" field and C files are compiled with gcc, and C++ files with g++. However, C files should be compiled with one set of options, and C++ files with others. Can I somehow set separate options for C and C++ files?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7048
  • Hero Points: 535
Re: C and C++ files in the project
« Reply #1 on: March 07, 2025, 02:48:28 PM »
You'll need to add a Rule for .c files which has different options. I manually added the rule to the .vpj file. I don't think this can be done through the GUI. Attached is a sample GNU C/C++ project where I've added a rule for .c files so I can use a different compiler (gcc instead of g++). You can change the options specified too. See gnucpp1.vpj.