Custom Project Macro definition error

Skip to first unread message

Shubhankar Kulkarni

Jul 2, 2022, 8:23:25 PMJul 2
to ProjectChrono
I am trying to implement a custom project using the tutorial steps enlisted. When I generate my project after giving the source, build and Chrono_DIR, I notice that the values of the CXX flags and C flags are as follows 

   CHRONO_CXX_FLAGS (Compiler flags): /DWIN32;/D_WINDOWS;/W3;/GR;/EHsc;-openmp;/arch:AVX2;/arch:AVX;/Zc:__cplusplus;/wd4275

   CHRONO_C_FLAGS (Compiler flags): /DWIN32;/D_WINDOWS;/W3;-openmp;/arch:AVX2;/arch:AVX;;/wd4275

these are getting generated from the ChronoConfig.cmake or ChronoConfig.cmake.install I suppose.

However when I load my solution and my project in VS, I'm seeing this error of command-line error:invalid macro definition (refer attachment below). Unable to resolve it.

Radu Serban

Jul 3, 2022, 4:11:59 AMJul 3
to ProjectChrono



I suspect the problem is that you are setting the compiler flags listed in the variable CHRONO_CXX_FLAGS using obsolete CMake syntax.  Take a look at: and make sure your CMakeLists.txt uses target_compile_options to set the C++ flags for your project, just like it’s done in the latest version of the code for the template_project example.


If this does not fix your problem, please provide more details:

  • Which version of Chrono you are working with
  • What version of CMake you have
  • What compiler version you have

And attach the CMakeLists.txt file for your project.



You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Shubhankar Kulkarni

Jul 7, 2022, 12:26:57 AMJul 7
to ProjectChrono

Thanks a lot for pointing me to the solution. I was able to get past the macro errors and get my project running.


Reply all
Reply to author
0 new messages