Hello,
I'm trying to compile a C app as C++, but it doesn't run. I looked at the .s files, and one difference with the C++ compilation is the line:
IMPORT ||Lib$$Request$$cpplib|| [CODE,WEAK]
Maybe this is the problem (or, one of the problems.)
Is there a way of preventing the compiler from including this library if I compile with the --cpp option?
We're taking a existing C project, adding the --cpp option, and compiling it. It produces a different binary file. Here are the first bytes of each binary, courtesy of linux "hexdump". The differences begin at line 0000050.
$ hexdump -v binary_image/C/ER_IROM1 | head 0000000 3f88 1000 033d 0001 0341 0001 0343 0001 0000010 0345 0001 0347 0001 0349 0001 0000 0000 0000020 0000 0000 0000 0000 0000 0000 034b 0001 0000030 034d 0001 0000 0000 034f 0001 0351 0001 0000040 0353 0001 0353 0001 0353 0001 0353 0001 0000050 0353 0001 1333 0001 133d 0001 1347 0001 0000060 1351 0001 0353 0001 0353 0001 0933 0001 0000070 093f 0001 0353 0001 0353 0001 0353 0001 0000080 0353 0001 0353 0001 0353 0001 0353 0001 0000090 0353 0001 0353 0001 0353 0001 0353 0001 $ hexdump -v binary_image/Cpp/ER_IROM1 | head 0000000 3f88 1000 033d 0001 0341 0001 0343 0001 0000010 0345 0001 0347 0001 0349 0001 0000 0000 0000020 0000 0000 0000 0000 0000 0000 034b 0001 0000030 034d 0001 0000 0000 034f 0001 0351 0001 0000040 0353 0001 0353 0001 0353 0001 0353 0001 0000050 0353 0001 0353 0001 0353 0001 0353 0001 0000060 0353 0001 0353 0001 0353 0001 0353 0001 0000070 0353 0001 0353 0001 0353 0001 0353 0001 0000080 0353 0001 0353 0001 0353 0001 0353 0001 0000090 0353 0001 0353 0001 0353 0001 0353 0001
These binaries are built with 2 different startup files. That was something that you needed to avoid.