title: Cannot find -lperl doing a makefile on c++
body: <p>sorry about my bad english...</p>
  
  <p>Well, I'm now to linux, perl and c++, but I have to do some codes for the university and I'm getting some troubles while doing the makefile.</p>
  
  <p>I have a code in perl which is running perfectly. As well, I have a code in C++ that calls perl as a subroutine. Everything is working properly, but when I do the makefile on my computer, it says: </p>
  
  <pre><code>sathlervbn Spam C # make clean; make
  rm -f *.o
  g++  -Wall  -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.14/CORE     -c -o main.o main.cpp
  g++ -L/usr/lib -Wall -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl/5.14/CORE -    lperl -ldl -lm -lpthread -lc -lcrypt -o main libSpam.a main.o
  /usr/bin/ld: cannot find -lperl
  collect2: error: ld returned 1 exit status
  make: *** [main] Error 1
  </code></pre>
  
  <p>The problem is that when I run the makefile in my professor's computer, it's works...</p>
  
  <p>Here is the code of makefile:</p>
  
  <pre><code>#CC= /usr/bin/g++
  CPP = g++
  CPPFLAGS = -Wall $(shell perl -MExtUtils::Embed -e ccopts)
  
  #LD= /usr/bin/g++
  LD = g++
  
  #LFLAGS = -Wall $(shell perl -MExtUtils::Embed -e ldopts)
  
  LFLAGS = -Wall -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl/5.14/CORE - lperl -ldl -lm -lpthread -lc -lcrypt
  
  MAINOBJS = libSpam.a main.o
  
  EMAILS = main
  
  EXECS = $(EMAILS)
  
  #Regra Implicita:
  .c.o:
      $(CPP) $(CPPFLAGS) -c $&lt;
  
  all: emails
  
  emails: $(EMAILS)
  
  main: $(MAINOBJS)
      $(LD) -L/usr/lib $(LFLAGS) -o $@ $(MAINOBJS)
  
  clean:
      rm -f *.o
  </code></pre>
  
  <p>Does anyone know how to solve it?    </p>