0

I'm trying to use Google's C++ compression library "Snappy" but I don't know how to link to it. On the GitHub page it says to link to it but does not say how.

I'm using code blocks and I have linked to other libraries in the past. I'm not sure exactly what file I should be linking to.

halfer
  • 19,824
  • 17
  • 99
  • 186
Kahless
  • 1,213
  • 2
  • 13
  • 31
  • 2
    You link it the same way you link any other library. – Retired Ninja Jan 01 '17 at 23:02
  • That's not exactly an answer. – Kahless Jan 01 '17 at 23:04
  • Threaten the library with your _Bat'leth_! – zx485 Jan 01 '17 at 23:08
  • Nice. I'll give that a shot. – Kahless Jan 01 '17 at 23:10
  • http://stackoverflow.com/questions/5862757/how-do-i-link-to-a-library-with-codeblocks – Retired Ninja Jan 01 '17 at 23:41
  • Get compiler to link it and have all headers necessary and included. Like first for any functions you are using from the api. As well as struct, class, or objects the api's use they all have to be defined somewhere in your code or included headers. Then fight the compiler to link it, don't know what compiler you are using. So you need some .dll or .lib and some .h's. – marshal craft Jan 02 '17 at 19:22
  • Thanks for the response. I'm using GNU GCC. I've spent a lot of time troubleshooting and I think there is an issue with the way it's building on my system. I say that because after doing what you listed above I get an error saying that it cant find libsnappy.so. When I scan my HD I can't find that file anywhere. I have rebuit but it does not seem to help. Any ideas? – Kahless Jan 02 '17 at 19:29
  • Are you on Linux? think .so is a dynamic link library (.dll on windows). You need to use them also maybe. On windows one way of using .dll's is essentially to use them as a regular static link library or .lib. When you do this you have two files, Somelibrary.lib and somelibrary.dll and you link to somelibrary.lib and it will work out everything just like linking. But you can also explicitly load the dynamic link library probably getting a process address for the dynamic link library and calling it's functions. – marshal craft Jan 03 '17 at 15:21

0 Answers0