Compiling C and C++ files together using GCC

后端 未结 6 927
[愿得一人]
[愿得一人] 2020-12-07 16:38

I\'m trying to compile C and C++ sources together using GCC.

gcc -std=c++0x test.cpp -std=c99 test.c -lstdc++

Now, this works fine, except that

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 17:37

    Instead of using gcc ,use g++.

    That is for both type of files, .cpp and .c files.

提交回复
热议问题