Advertisement
B1KMusic

How I compiled pastebincl on linux

Dec 26th, 2013
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. First, I followed the instructions included in the tar.gz, usually, this is enough to get it running...right?
  2.  
  3. Apparently not.
  4.  
  5. This is my second time trying to install this, and I've finally succeeded. Other people will have trouble compiling and installing, so here's how I did it:
  6.  
  7. 1) I installed the missing curl library, as per compile error
  8.  
  9. sudo apt-get install libcurl4-openssl-dev
  10.  
  11. 2) I went into the src and edited the Makefile, because the compile instructions were actually wrong/malformed
  12.  
  13. cd src
  14. vi Makefile
  15.  
  16. a) I edited the compile instructions from this:
  17.  
  18. CXXFLAGS=-Wall -Werror -O2
  19.  
  20. $(CXX) $(CXXLIBS) $^ $(CXXFLAGS) -o $@
  21. $(CXX) $(CXXLIBS) -c $< $(CXXFLAGS) -o $@ -DENCODING_KEY=\"${ENC_KEY}\"
  22. $(CXX) $(CXXLIBS) -c $< $(CXXFLAGS) -o $@
  23.  
  24. to this:
  25.  
  26. CXXFLAGS=-Wall
  27.  
  28. $(CXX) $^ $(CXXFLAGS) -o $@ $(CXXLIBS)
  29. $(CXX) -c $< $(CXXFLAGS) -o $@ -DENCODING_KEY=\"${ENC_KEY}\" $(CXXLIBS)
  30. $(CXX) -c $< $(CXXFLAGS) -o $@ $(CXXLIBS)
  31.  
  32. See what I did? I moved the library links to the end of each line and removed the redundant -Werror, as well as the potentially error-prone -O2 optimizing flag
  33.  
  34. 3) While there:
  35.  
  36. make
  37.  
  38. This time, it worked!
  39.  
  40. I had a suspicion it was the g++ line when I noticed the link at the beginning, and if this hadn't worked, I would have given up. I was that close to total frustration.
  41.  
  42. 4) I exited src and then installed
  43.  
  44. cd ../
  45. sudo make install
  46.  
  47. 5) I tested it out, and lo and behold, it worked
  48.  
  49. pastebincl -g <enter>
  50. Hello World
  51. ^D
  52. saving to pastebin...
  53.  
  54. In fact, this paste right here, was sent via pastebincl
  55.  
  56. cat how_I_Compiled_this | pastebincl -n 'How I compiled pastebincl on linux'
  57.  
  58. Bastian, if you're reading this, I'm letting you know right now that your Makefile is broken. -lxxxx flags are supposed to go at the end of a gcc command.
  59.  
  60. -Braden Best a.k.a B1KMusic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement