1 diff --git a/Makefile b/Makefile
2 index 08e5db2..27235be 100644
6 # Authors: see AUTHORS file
7 #===========================================================================
9 -TARGETS = lib/kinematics src/common src/Base src/InvKin src/LM src/kni_wrapper py demo
10 +TARGETS = lib/kinematics src/common src/Base src/InvKin src/LM src/kni_wrapper demo
11 TARGETS_B = $(foreach target,$(TARGETS),$(target).build)
12 TARGETS_C = $(foreach target,$(TARGETS),$(target).clean)
13 NEURONICS_DOC_DIR = doc/neuronics-doc/source
14 diff --git a/demo/Makefile b/demo/Makefile
15 index df71b21..088b032 100644
18 @@ -37,7 +37,7 @@ $(CTARGETS_D):
20 $(TARGETS_D): $(CTARGETS_D)
22 - $(CXX) $(CXXFLAGS) -I$(INCLUDE_DIR) -lpthread -o $(@:.demo=)/$(@:.demo=) $(wildcard $(@:.demo=)/*.cpp) ${AVAILABLE_LIBRARIES}
23 + $(CXX) $(CXXFLAGS) -I$(INCLUDE_DIR) -pthread -o $(@:.demo=)/$(@:.demo=) $(wildcard $(@:.demo=)/*.cpp) ${AVAILABLE_LIBRARIES}
27 diff --git a/lib/kinematics/Makefile b/lib/kinematics/Makefile
28 index e05bd01..6c577d2 100644
29 --- a/lib/kinematics/Makefile
30 +++ b/lib/kinematics/Makefile
33 #===========================================================================
35 -CXXFLAGS += -c -Wall -D_REENTRANT -D__NO_MATH_INLINES -pthread -I $(BOOST_INCLUDE_DIR)
36 +CXXFLAGS += -fPIC -c -Wall -D_REENTRANT -D__NO_MATH_INLINES -pthread -I $(BOOST_INCLUDE_DIR)
38 LDFLAGS = -shared -fPIC
40 diff --git a/lib/kinematics/roboop/Makefile b/lib/kinematics/roboop/Makefile
41 index 74cbf5d..8681d38 100644
42 --- a/lib/kinematics/roboop/Makefile
43 +++ b/lib/kinematics/roboop/Makefile
44 @@ -7,7 +7,7 @@ CC = g++
45 # edit the following to reflect the location of boost include files
46 # if not in the defaut (/usr/include)
47 BOOST_INCLUDE_DIR=/usr/include
48 -CFLAGS = -O -I $(BOOST_INCLUDE_DIR) -I ./source -I ./newmat -Wall -D_REENTRANT -pthread #-Duse_namespace #-fno-const-strings
49 +CFLAGS = -fPIC -O -I $(BOOST_INCLUDE_DIR) -I ./source -I ./newmat -Wall -D_REENTRANT -pthread #-Duse_namespace #-fno-const-strings
50 LIBS = -L./ -lroboop -lnewmat -lm -pthread
53 diff --git a/src/Base/cdlSocket.cpp b/src/Base/cdlSocket.cpp
54 index 2afc54e..9585ce9 100644
55 --- a/src/Base/cdlSocket.cpp
56 +++ b/src/Base/cdlSocket.cpp
58 /****************************************************************************/
59 #include "KNI/cdlSocket.h"
62 /****************************************************************************/
65 @@ -91,8 +92,9 @@ CCdlSocket::CCdlSocket(char* ipAddr, int port): _ipAddr(ipAddr), _port(port){
67 _socketfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
69 - std::cout << "socket could not be created"<<_ipAddr<<" port: "<< _port<<" \n";
71 + std::ostringstream s;
72 + s << "socket could not be created"<<_ipAddr<<" port: "<< _port<<" \n";
73 + throw Exception( s.str().c_str(), 0 );
75 memset(&_socketAddr, 0, sizeof(_socketAddr));
76 _socketAddr.sin_family = AF_INET;
77 @@ -102,14 +104,16 @@ CCdlSocket::CCdlSocket(char* ipAddr, int port): _ipAddr(ipAddr), _port(port){
78 //connect to the server
79 res = inet_pton ( AF_INET, _ipAddr, &_socketAddr.sin_addr );
80 if ( errno == EAFNOSUPPORT ){
81 - std::cout << "inet_pton failed, try again "<<_ipAddr<<" port: "<< _port<<" \n";
83 + std::ostringstream s;
84 + s << "inet_pton failed, try again "<<_ipAddr<<" port: "<< _port<<" \n";
85 + throw Exception( s.str().c_str(), 0 );
87 // std::cout << "trying to connect to server...\n";
88 res = connect(_socketfd, (struct sockaddr *) &_socketAddr, _len);
90 - std::cout << "client could not connect, check if server is running on ip "<<_ipAddr<<" port: "<< _port<<" \n";
92 + std::ostringstream s;
93 + s << "client could not connect, check if server is running on ip "<<_ipAddr<<" port: "<< _port<<" \n";
94 + throw Exception( s.str().c_str(), 0 );
97 // std::cout << "client connected to ip "<<_ipAddr<<", port: "<< _port<<" \n";
98 diff --git a/src/common/Makefile b/src/common/Makefile
99 index 8ec540c..c7460b5 100644
100 --- a/src/common/Makefile
101 +++ b/src/common/Makefile
103 #===========================================================================
106 -CXXFLAGS += -g -O2 -Wall
107 +CXXFLAGS += -g -O2 -Wall -fPIC