How to create a separate library for inclusion in C ++ / Eclipse

I have C ++ code to work with the TinyXML parser. However, for this I had to include the source code from TinyXML with my regular source code. I would like to include TinyXML as a separate library. I am using Eclipse with the Cygwin C ++ compiler. What a good way to do this?

+3
source share
2 answers

I assume that you want to separate the library from the projectโ€™s own source code ... but you donโ€™t know how to create when the library is not in the same folder.


Assuming your library precompiled * .lib and * .h files:

  • Move library source code to a separate directory
  • Menubar
  • "" , .
  • "C/++ Build" gcc-// ( ... ). [1]
  • GCC C โ†’ :
    screenshot-properties-for-test-1.png
  • " " [2] โ†’ *.h
  • ( , , )
  • GCC C Linker โ†’ :
    screenshot-properties-for-test.png
  • (-L) โ†’ " " โ†’ *.lib
  • (-l) โ†’ โ†’ ,
  • ,

[ - 1] GUI C/++ / gcc... , .

[ - 2] "+" - , , *.h include. *.h, , .


, ( ) *.c *.h:

  • , , 7.
  • 7. , .cc Eclipse "managed make". , , , .
+4

. ar (1). , , - ; UNIX .

.

Eclipse , IDE, , .

, DLL, . .

+2

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


All Articles