Solaris 10 CC Preprocessor bug causes undefined symbols

前端 未结 1 708
粉色の甜心
粉色の甜心 2021-01-20 20:57

I have a very very simple C++ file as follows that I\'m compiling on Solaris 5-10 with the CC compiler. Here is the source code in my file myTest.C:

#include         


        
相关标签:
1条回答
  • 2021-01-20 21:27

    Try using CC -E in place of CC -P. When I do this thenm(1) listings are the same and the object files only differ by a few bytes (given that I can see the names of the *.c and *.i files in the *.o this difference is not surprising).

    The man page doesn't really explain the difference between the two flags but does stress C++ for -E so I wonder if -P was intended to be C only.

    If you're trying to work out what the direct method really entails, then this might prove enlightening:

    truss -f -a -texec CC myFile.C
    

    The direct compilation method doesn't call CC -P or CC -E but instead invokes ccfe with a whole raft of flags (and then fbe then ld...).

    0 讨论(0)
提交回复
热议问题