C Compilation: error: deviation '\ 4' in the program; octal stream?

Trying to compile downloading .c files

(1) Files are compiled in order using cc

cc -Wall -Wextra -Wunreachable-code -ggdb -O0 *.c 

(2) Then I need to make a static library from the final output in order to use it in a C ++ program. So I:

ar cru liborientdb-c.a *.o

(3) It works fine. However, when I come to compile C ++, the testme.cpp program, which includes the library in line # 1

(line 1 of testme.cpp)
#include "liborientdb-c.a"

Compile the step:

cc testme.cpp

I get this error:

liborientdb-c.a:117:22: error: stray '\3' in program
liborientdb-c.a:117:263: warning: null character(s) ignored [enabled by default]
liborientdb-c.a:117:22: error: stray '\17' in program
liborientdb-c.a:117:265: warning: null character(s) ignored [enabled by default]
liborientdb-c.a:117:283: warning: null character(s) ignored [enabled by default]
liborientdb-c.a:117:22: error: stray '\22' in program
liborientdb-c.a:117:287: warning: null character(s) ignored [enabled by default]
liborientdb-c.a:117:22: error: stray '\1' in program
liborientdb-c.a:117:289: warning: null character(s) ignored [enabled by default]
liborientdb-c.a:117:22: error: stray '\362' in program
....

So, following the advice on other publications here , I believe that errors can be caused by corrupted encoding.

, 'od -c' , " " . .o "od -c" , , .

EG.

0000000 177   E   L   F 002 001 001  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000020 001  \0   >  \0 001  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000040  \0  \0  \0  \0  \0  \0  \0  \0   `   (  \0  \0  \0  \0  \0  \0
0000060  \0  \0  \0  \0   @  \0  \0  \0  \0  \0   @  \0 026  \0 023  \0
0000100   U   H 211   ?   H 203   ? 020   H 211   }   ?   H 211   u   ?
0000120   H 213   E   ?   H 213  \0   H 213   @  \b   H 205   ?   t 023
0000140   H 213   E   ?   H 213  \0   H 213   @  \b   H 211   ?   ?  \0

? lib

recode UTF8..ISO-8859-15 *.c

: ( ). , .c , UTF-8, , -, ASCII. , , .

.o - .

???

+1
2
#include "liborientdb-c.a"

.a C. .

.a .

cc -o - .o file2.o liborientdb-c.a .. ..

+9

.cpp

(line 1 of testme.cpp)
#include "liborientdb-c.a"

"liborientdb-c.h" (, , , .h.h).

makefile .a.

+3

Source: https://habr.com/ru/post/1658186/


All Articles