Problem with C ++ compilation

I am trying to compile C ++ - a program that I have not done for a long time ...

I'm trying to:

g++ -c A.cpp  -o A.o

g++ -c dir/B.h -o B.o

which seem to work, and then I try:

g++ A.o B.o -o A -lX11 -lpthread

and get:

Bo: file not recognized: file format not recognized

collect2: ld returned 1 exit status

What is the problem?

Many thanks:)

+3
source share
3 answers

-o b.h, , , g++ b.h.gch, b.o. " ". b.o, g++ . b.h , a.cpp. b.h , b.cpp.

+8
g++ -c dir/B.h -o B.o

?

, a.cpp /B.h. -

+3

. .: -)

0

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


All Articles