I am trying to link to a .so library file from a makefile. I have three files in my project: main.cpp, shm.h, and shm.cpp. main.cpp includes the shm class. Furthermore, the shm class relies on several header files stored within the alcommon library (libalcommon.so).
My makefile is currently written as follows. My thinking is that the .so file should be a dependency for shm.o, and therefore should be included as such.
Variables
CXXFLAGS=-Wall -g
CXX = g++
#Executable
#TransformTests: TransformTests.o Transform.o
# $(CXX) $(CXXFLAGS) -o TransformTests TransformTests.o Transform.o
#Dynamics Library Creation
#Object Targets
main.o: main.cpp shm.h
#(CXX) $(CXXFLAGS) -c main.cpp
shm.o: shm.cpp shm.h -L../../naoqi-sdk-2.1.3.3-linux32/lib -lalcommon
$(CXX) $(CXXFLAGS) -c shm.cpp
clean:
rm -f *o main
rm -f *o shm
all: shm main