Possible Duplicate:
Linking C++ code with 'gcc开发者_开发百科9; (without g++)
GCC provides the -x lang option, which allows you to modify the assumed language during compilation. What is the equivalent for the link step? I wish to link a program that has C++ dependencies via the gcc command.
You need to link against libstdc++ by passing -lstdc++.
Using the -lstdc++ flag should do the job.
You need to run the g++ frontend instead. (automake also does that as you will see - it calls CXXLD instead of CCLD when one of the source files is .cpp.) [Just using gcc with -lstdc++ won't help, because the gcc and g++ frontends can use different linker commands. On mine, gcc adds --as-needed when calling the linker, while g++ doesn't.]
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论