In my app.cpp file I have the following line: #include "indri/Repository.hpp"
However when I run make (makefile below): I get the following error:
indri/Repository.hpp:22:32: error: indri/Parameters.hpp: No such file or directory
The reason is that the Repository.hpp includes other hpp in the same folder but it uses "indri/*.hpp" instead of just "*.hpp".
What am I missing ?
thanks
## your application name here
APP=myapp
SRC=$(APP).cpp
## extra object files for your app here
OBJ=
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
includedir = ${prefix}/include
INCPATH=-I$(includedir)
LIBPATH=-L$(libdir)
CXXFLAGS=-DPACKAGE_NAME=\"Indri\" -DPACKAGE_TARNAME=\"indri\" -DPACKAGE_VERSION=\"5.0\" -DPACKAGE_STRING=\"Indri\ 5.0\" -DPACKAGE_BUGREPORT=\"project#lemurproject.org\" -DYYTEXT_POINTER=1 -DINDRI_STANDALONE=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBZ=1 -DHAVE_NAMESPACES= -DISNAN_IN_NAMESPACE_STD= -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DNDEBUG=1 -g -O3 $(INCPATH)
CPPLDFLAGS = -lindri -lz -lpthread -lm
all:
$(CXX) $(CXXFLAGS) $(SRC) -o $(APP) $(OBJ) $(LIBPATH) $(CPPLDFLAGS)
clean:
rm -f $(APP)
Did you forget to add the current directory?
## your application name here
APP=myapp
SRC=$(APP).cpp
## extra object files for your app here
OBJ=
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
includedir = ${prefix}/include
INCPATH=-I$(includedir) -I. # can you spot the difference?
LIBPATH=-L$(libdir)
CXXFLAGS=-DPACKAGE_NAME=\"Indri\" -DPACKAGE_TARNAME=\"indri\" -DPACKAGE_VERSION=\"5.0\" -DPACKAGE_STRING=\"Indri\ 5.0\" -DPACKAGE_BUGREPORT=\"project#lemurproject.org\" -DYYTEXT_POINTER=1 -DINDRI_STANDALONE=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBZ=1 -DHAVE_NAMESPACES= -DISNAN_IN_NAMESPACE_STD= -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DNDEBUG=1 -g -O3 $(INCPATH)
CPPLDFLAGS = -lindri -lz -lpthread -lm
all:
$(CXX) $(CXXFLAGS) $(SRC) -o $(APP) $(OBJ) $(LIBPATH) $(CPPLDFLAGS)
clean:
rm -f $(APP)
Related
I want to compile a CMake project using SDL2 and SDL_ttf library.
I copied "SDL_ttf.c" & "SDL_ttf.h" into my src folder.
(EDIT: removed it, see comments)
I also added this to my CMakeLists.txt:
include_directories(${SDL2_TTF_INCLUDE_DIR})
freetype2 is also installed
but i get the error after calling make
src/SDL_ttf.c:28:10: fatal error: ft2build.h: No such file or directory
28 | #include <ft2build.h>
How do i properly install SDL_ttf to my system?
(https://github.com/libsdl-org/SDL_ttf/blob/main/CMakeLists.txt)
EDIT:
my CMakeLists.txt:
cmake_minimum_required(VERSION 3.7)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-std=c++17)
set(CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS, "${CXX_FLAGS}")
project(SDL2Test)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
find_package(SDL2 REQUIRED)
find_package(SDL2_ttf REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS} src)
include_directories(${SDL2_TTF_INCLUDE_DIR})
add_executable(Zokoban src/main.cpp src/game.cpp src/controller.cpp src/renderer.cpp src/hero.cpp src/level.cpp)
string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES)
target_link_libraries(Zokoban ${SDL2_LIBRARIES} ${SDL2_TTF_INCLUDE_DIR})
EDIT2:
after sudo make install (SDL_ttf source) and removing the SDL-source files from my repo:
[ 57%] Building CXX object CMakeFiles/Zokoban.dir/src/renderer.cpp.o
/07_Capstone/Zokoban/src/renderer.cpp:9:10: fatal error: SDL_ttf.h: No such file or directory
9 | #include <SDL_ttf.h>
EDIT3
On another machine (debian11) i couldn't even compile the SDL_ttf - source
19:46 $
✔ ~/ThirdParty/SDL_ttf/build [main|✚ 3…1]
19:46 $ make
/bin/bash ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"SDL2_ttf\" -DPACKAGE_TARNAME=\"SDL2_ttf\" -DPACKAGE_VERSION=\"2.21.0\" -DPACKAGE_STRING=\"SDL2_ttf\ 2.21.0\" -DPACKAGE_BUGREPORT=\"https://github.com/libsdl-org/SDL_ttf/issues\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSDL_BUILD_MAJOR_VERSION=2 -DSDL_BUILD_MINOR_VERSION=21 -DSDL_BUILD_MICRO_VERSION=0 -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.21.0\" -DTTF_USE_HARFBUZZ=1 -DHAVE_CXX11=1 -DALIGNOF_STRUCT_CHAR__=1 -I. -I.. -I../external/freetype/include -DFT2_BUILD_LIBRARY -DFT_PUBLIC_FUNCTION_ATTRIBUTE= -I../external/harfbuzz -I../external/harfbuzz/src -DHAVE_CONFIG_H -DFT_CONFIG_OPTION_USE_HARFBUZZ -g -O2 -D_REENTRANT -I/usr/include/SDL2 -Wall -fvisibility=hidden -DHAVE_OPENGL -MT libSDL2_ttf_la-SDL_ttf.lo -MD -MP -MF .deps/libSDL2_ttf_la-SDL_ttf.Tpo -c -o libSDL2_ttf_la-SDL_ttf.lo `test -f 'SDL_ttf.c' || echo '../'`SDL_ttf.c
libtool: compile: gcc -DPACKAGE_NAME=\"SDL2_ttf\" -DPACKAGE_TARNAME=\"SDL2_ttf\" -DPACKAGE_VERSION=\"2.21.0\" "-DPACKAGE_STRING=\"SDL2_ttf 2.21.0\"" -DPACKAGE_BUGREPORT=\"https://github.com/libsdl-org/SDL_ttf/issues\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSDL_BUILD_MAJOR_VERSION=2 -DSDL_BUILD_MINOR_VERSION=21 -DSDL_BUILD_MICRO_VERSION=0 -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.21.0\" -DTTF_USE_HARFBUZZ=1 -DHAVE_CXX11=1 -DALIGNOF_STRUCT_CHAR__=1 -I. -I.. -I../external/freetype/include -DFT2_BUILD_LIBRARY -DFT_PUBLIC_FUNCTION_ATTRIBUTE= -I../external/harfbuzz -I../external/harfbuzz/src -DHAVE_CONFIG_H -DFT_CONFIG_OPTION_USE_HARFBUZZ -g -O2 -D_REENTRANT -I/usr/include/SDL2 -Wall -fvisibility=hidden -DHAVE_OPENGL -MT libSDL2_ttf_la-SDL_ttf.lo -MD -MP -MF .deps/libSDL2_ttf_la-SDL_ttf.Tpo -c ../SDL_ttf.c -fPIC -DPIC -o .libs/libSDL2_ttf_la-SDL_ttf.o
../SDL_ttf.c:28:10: fatal error: ft2build.h: No such file or directory
28 | #include <ft2build.h>
| ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:1539: libSDL2_ttf_la-SDL_ttf.lo] Error 1
.. although ft2build.h is obviously installed:
ls /usr/include/freetype2/
freetype ft2build.h
EDIT4:
I downloaded from https://github.com/libsdl-org/SDL_ttf/releases "SDL2_ttf-2.20.0.tar.gz". And could configure, make and sudo make install SDL_ttf.
... but make my project is still not possible
18:03 $ make
[ 14%] Building CXX object CMakeFiles/Zokoban.dir/src/main.cpp.o
[ 28%] Building CXX object CMakeFiles/Zokoban.dir/src/game.cpp.o
[ 42%] Building CXX object CMakeFiles/Zokoban.dir/src/controller.cpp.o
[ 57%] Building CXX object CMakeFiles/Zokoban.dir/src/renderer.cpp.o
/home/Zokoban/src/renderer.cpp:9:10: fatal error: SDL_ttf.h: No such file or directory
9 | #include <SDL_ttf.h>
| ^~~~~~~~~~~
When i tried it with the released sourcecode i get still the error.
~/learning/ThirdParty/SDL_ttf-release-2.20.0/build$ make
depbase=`echo showfont.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DPACKAGE_NAME=\"SDL2_ttf\" -DPACKAGE_TARNAME=\"SDL2_ttf\" -DPACKAGE_VERSION=\"2.20.0\" -DPACKAGE_STRING=\"SDL2_ttf\ 2.20.0\" -DPACKAGE_BUGREPORT=\"https://github.com/libsdl-org/SDL_ttf/issues\" -DPACKAGE_URL=\"\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSDL_BUILD_MAJOR_VERSION=2 -DSDL_BUILD_MINOR_VERSION=20 -DSDL_BUILD_MICRO_VERSION=0 -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.20.0\" -DTTF_USE_HARFBUZZ=1 -DHAVE_CXX11=1 -DALIGNOF_STRUCT_CHAR__=1 -I. -I.. -g -O2 -D_REENTRANT -I/usr/include/SDL2 -Wall -fvisibility=hidden -DHAVE_OPENGL -MT showfont.o -MD -MP -MF $depbase.Tpo -c -o showfont.o ../showfont.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/bash ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"SDL2_ttf\" -DPACKAGE_TARNAME=\"SDL2_ttf\" -DPACKAGE_VERSION=\"2.20.0\" -DPACKAGE_STRING=\"SDL2_ttf\ 2.20.0\" -DPACKAGE_BUGREPORT=\"https://github.com/libsdl-org/SDL_ttf/issues\" -DPACKAGE_URL=\"\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSDL_BUILD_MAJOR_VERSION=2 -DSDL_BUILD_MINOR_VERSION=20 -DSDL_BUILD_MICRO_VERSION=0 -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.20.0\" -DTTF_USE_HARFBUZZ=1 -DHAVE_CXX11=1 -DALIGNOF_STRUCT_CHAR__=1 -I. -I.. -I../external/freetype/include -DFT2_BUILD_LIBRARY -DFT_PUBLIC_FUNCTION_ATTRIBUTE= -I../external/harfbuzz -I../external/harfbuzz/src -DHAVE_CONFIG_H -DFT_CONFIG_OPTION_USE_HARFBUZZ -g -O2 -D_REENTRANT -I/usr/include/SDL2 -Wall -fvisibility=hidden -DHAVE_OPENGL -MT libSDL2_ttf_la-SDL_ttf.lo -MD -MP -MF .deps/libSDL2_ttf_la-SDL_ttf.Tpo -c -o libSDL2_ttf_la-SDL_ttf.lo `test -f 'SDL_ttf.c' || echo '../'`SDL_ttf.c
libtool: compile: gcc -DPACKAGE_NAME=\"SDL2_ttf\" -DPACKAGE_TARNAME=\"SDL2_ttf\" -DPACKAGE_VERSION=\"2.20.0\" "-DPACKAGE_STRING=\"SDL2_ttf 2.20.0\"" -DPACKAGE_BUGREPORT=\"https://github.com/libsdl-org/SDL_ttf/issues\" -DPACKAGE_URL=\"\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSDL_BUILD_MAJOR_VERSION=2 -DSDL_BUILD_MINOR_VERSION=20 -DSDL_BUILD_MICRO_VERSION=0 -DPACKAGE=\"SDL2_ttf\" -DVERSION=\"2.20.0\" -DTTF_USE_HARFBUZZ=1 -DHAVE_CXX11=1 -DALIGNOF_STRUCT_CHAR__=1 -I. -I.. -I../external/freetype/include -DFT2_BUILD_LIBRARY -DFT_PUBLIC_FUNCTION_ATTRIBUTE= -I../external/harfbuzz -I../external/harfbuzz/src -DHAVE_CONFIG_H -DFT_CONFIG_OPTION_USE_HARFBUZZ -g -O2 -D_REENTRANT -I/usr/include/SDL2 -Wall -fvisibility=hidden -DHAVE_OPENGL -MT libSDL2_ttf_la-SDL_ttf.lo -MD -MP -MF .deps/libSDL2_ttf_la-SDL_ttf.Tpo -c ../SDL_ttf.c -fPIC -DPIC -o .libs/libSDL2_ttf_la-SDL_ttf.o
../SDL_ttf.c:28:10: fatal error: ft2build.h: No such file or directory
28 | #include <ft2build.h>
| ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:1536: libSDL2_ttf_la-SDL_ttf.lo] Error 1
My ideas run out :(
I'm on a personal project and when I go to compile my project the following message appears:
Makefile.win:26: recipe for target 'NightHunterServer.exe' failed
mingw32-make.exe: *** [NightHunterServer.exe] Error 1
my Makefile.win looks like this:
# Project: NightHunterServer
# Makefile created by Dev-C++ 5.11
CPP = g++.exe -D__DEBUG__
CC = gcc.exe -sdd = c ++ 11 -D__DEBUG__
WINDRES = windres.exe
RES = "../Night Hunter/Night_Hunter_Server_private.res"
OBJ = "../Night\ Hunter/account.o" "../Night\ Hunter/actions.o" "../Night\ Hunter/ban.o"$(RES)
LINKOBJ = "../Night\ Hunter/account.o" "../Night\ Hunter/actions.o" "../Night\ Hunter/ban.o"$(RES)
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -lboost_filesystem -lboost_system -lmysql -lboost_regex -lwsock32 -lxml2 -lmysql -lws2_32 -lboost_filesystem -lboost_thread -lz -lcryptopp -lsqlite3 -llua5.1 -leay32 -lgmp -s -g3
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Boost"
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++" -I"C:/Boost"
BIN = NightHunterServer.exe
CXXFLAGS = $(CXXINCS) -std=c++11 -fsyntax-only -g3 -g -D__USE_MYSQL__ -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -O2 -D__CONSOLE__ -D__WAR_SYSTEM__ -D__GROUND_CACHE__ -D__ROOT_PERMISSION__
CFLAGS = $(INCS) -std=c++11 -fsyntax-only -g3 -g
RM
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom
${RM} $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS)
"../Night\ Hunter/account.o": ../src/account.cpp
$(CPP) -c ../src/account.cpp -o "../Night Hunter/account.o" $(CXXFLAGS)
"../Night\ Hunter/actions.o": ../src/actions.cpp
$(CPP) -c ../src/actions.cpp -o "../Night Hunter/actions.o" $(CXXFLAGS)
"../Night\ Hunter/ban.o": ../src/ban.cpp
$(CPP) -c ../src/ban.cpp -o "../Night Hunter/ban.o" $(CXXFLAGS)
"../Night Hunter/Night_Hunter_Server_private.res": Night_Hunter_Server_private.rc
$(WINDRES) -i Night_Hunter_Server_private.rc --input-format=rc -o "../Night Hunter/Night_Hunter_Server_private.res" -O coff
and the error points me to this line: $ (CPP) $ (LINKOBJ) -o $ (BIN) $ (LIBS)
How can I resolve this issue?
I've been trying to install a third-party library PicklingTools into my windows environment and need to build it using Makefile.Linux. I'm using make from Cygwin, version 4.3 and g++ version 9.2.0.
My Makefile.Linux is as follows:
CC = g++
# CC = icc # Intel seems to work
## With g++ --version==4.4.x, you may need -fno-strict-aliasing to get rid
## of some annoying warnings when you compile with -O2 or above
# *****CAREFUL! g++ 4.5.1 20100924 DOES NOT WORK with Ptools and -O. You must
# compile without optimization for that compiler to work
OC = ./opencontainers_1_8_5
OCINC = $(OC)/include
CFLAGS = -Wall -Wextra -fpic -O -fno-strict-aliasing -DLINUX_ -DOC_NEW_STYLE_INCLUDES -Wno-deprecated -I$(OCINC) -pthread -D_REENTRANT
## How to build with OCString
##CFLAGS = -Wall -O4 -DLINUX_ -DOC_USE_OC_STRING -DOC_USE_OC_EXCEPTIONS -DOC_ONLY_NEEDED_STL -DOC_NEW_STYLE_INCLUDES -Wno-deprecated -I$(OCINC)
###### CFLAGS = -Wall -O4 -DLINUX_-DOC_NEW_STYLE_INCLUDES -Wno-deprecated -I$(OCINC)
CCFLAGS = -pthread $(CFLAGS)
COM_OBJS = m2pythontools.o valpython.o midassocket.o valprotocol2.o m2ser.o m2streamdataenc.o m2convertrep.o timeconv.o fdtools.o
OBJS = midastalker_ex.o midastalker_ex2.o httpclient_ex.o httpserver_ex.o $(COM_OBJS) load.o save.o sharedmemory.o
all: midasyeller_ex midastalker_ex midastalker_ex2 httpclient_ex midasserver_ex permutation_server permutation_client load save opal2dict dict2opal opaltest midasyeller_ex midaslistener_ex p2_test valgetopt_ex sharedmem_test ready_test xmlload_test xmlload_ex xmldump_test xmldump_ex speed_test pickleloader_test chooseser_test xml2dict dict2xml serverside_ex clientside_ex middleside_ex
.cc.o:
$(CC) $(CFLAGS) -c $<
libptools.so : $(COM_OBJS)
$(CC) $(CCFLAGS) $(COM_OBJS) -shared -o libptools.so
midasserver_ex : $(COM_OBJS) midasserver_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) midasserver_ex.o -pthread -o midasserver_ex
httpclient_ex : $(COM_OBJS) httpclient_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) httpclient_ex.o -pthread -o httpclient_ex
httpserver_ex : $(COM_OBJS) httpserver_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) httpserver_ex.o -pthread -o httpserver_ex
midasyeller_ex : $(COM_OBJS) midasyeller_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) midasyeller_ex.o -pthread -o midasyeller_ex
midaslistener_ex : $(COM_OBJS) midaslistener_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) midaslistener_ex.o -pthread -o midaslistener_ex
permutation_server : $(COM_OBJS) permutation_server.o
$(CC) $(CCFLAGS) $(COM_OBJS) permutation_server.o -pthread -o permutation_server
permutation_client : $(COM_OBJS) permutation_client.o
$(CC) $(CCFLAGS) $(COM_OBJS) permutation_client.o -pthread -o permutation_client
midastalker_ex :$(COM_OBJS) midastalker_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) midastalker_ex.o -o midastalker_ex
midastalker_ex2 :$(COM_OBJS) midastalker_ex2.o
$(CC) $(CCFLAGS) $(COM_OBJS) midastalker_ex2.o -o midastalker_ex2
load = load
$(load) : $(COM_OBJS) load.o
$(CC) $(CCFLAGS) $(COM_OBJS) load.o -o load
serverside_ex : $(COM_OBJS) sharedmem.o shmboot.o serverside_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o shmboot.o -lrt serverside_ex.o -o serverside_ex
middleside_ex : $(COM_OBJS) middleside_ex.o sharedmem.o shmboot.o
$(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o shmboot.o -l rt middleside_ex.o -o middleside_ex
clientside_ex : $(COM_OBJS) clientside_ex.o sharedmem.o shmboot.o
$(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o shmboot.o -lrt clientside_ex.o -o clientside_ex
samplehttpserver_ex : $(COM_OBJS) samplehttpserver_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) samplehttpserver_ex.o -o samplehttpserver_ex
save : $(COM_OBJS) save.o
$(CC) $(CCFLAGS) $(COM_OBJS) save.o -o save
opal2dict : $(COM_OBJS) opal2dict.o
$(CC) $(CCFLAGS) $(COM_OBJS) opal2dict.o -o opal2dict
opaltest : $(COM_OBJS) opaltest.o
$(CC) $(CCFLAGS) $(COM_OBJS) opaltest.o -o opaltest
ready_test : $(COM_OBJS) ready_test.o
$(CC) $(CCFLAGS) $(COM_OBJS) ready_test.o -o ready_test
chooseser_test : $(COM_OBJS) chooseser_test.o
$(CC) $(CCFLAGS) $(COM_OBJS) chooseser_test.o -o chooseser_test
dict2opal : $(COM_OBJS) dict2opal.o
$(CC) $(CCFLAGS) $(COM_OBJS) dict2opal.o -o dict2opal
pickleloader_test : $(COM_OBJS) pickleloader_test.o
$(CC) $(CCFLAGS) $(COM_OBJS) pickleloader_test.o -o pickleloader_test -lrt
xmldump_test : $(COM_OBJS) xmldump_test.o
$(CC) $(CCFLAGS) $(COM_OBJS) xmldump_test.o -o xmldump_test -lrt
xmldump_ex : $(COM_OBJS) xmldump_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) xmldump_ex.o -o xmldump_ex -lrt
xmlload_test : $(COM_OBJS) xmlload_test.o
$(CC) $(CCFLAGS) $(COM_OBJS) xmlload_test.o -o xmlload_test -lrt
xmlload_ex : $(COM_OBJS) xmlload_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) xmlload_ex.o -o xmlload_ex -lrt
xml2dict : $(COM_OBJS) xml2dict.o
$(CC) $(CCFLAGS) $(COM_OBJS) xml2dict.o -o xml2dict -lrt
dict2xml : $(COM_OBJS) dict2xml.o
$(CC) $(CCFLAGS) $(COM_OBJS) dict2xml.o -o dict2xml -lrt
speed_test : $(COM_OBJS) speed_test.o
$(CC) $(CCFLAGS) $(COM_OBJS) speed_test.o -o speed_test -lrt
p2_test : $(COM_OBJS) p2_test.o
$(CC) $(CCFLAGS) $(COM_OBJS) p2_test.o -o p2_test -lrt
valgetopt_ex : $(COM_OBJS) valgetopt_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) valgetopt_ex.o -o valgetopt_ex
json_ex : $(COM_OBJS) json_ex.o
$(CC) $(CCFLAGS) $(COM_OBJS) json_ex.o -o json_ex
# Only the tests that REALLY uses UNIX shared memory need the -lrt
sharedmem_test : $(COM_OBJS) sharedmem_test.o sharedmem.o
$(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o -lrt sharedmem_test.o -o sharedmem_test
# Only the tests that REALLY uses UNIX shared memory need the -lrt
checkshm_test : $(COM_OBJS) checkshm_test.o sharedmem.o
$(CC) $(CCFLAGS) $(COM_OBJS) sharedmem.o -lrt checkshm_test.o -o checkshm_test
clean :
/bin/rm -rf *.o *.so *~ midastalker_ex midastalker_ex2 httpserver_ex httpclient_ex midasserver_ex midasyeller_ex midaslistener_ex permutation_server permutation_client load save cxx_repository opal2dict opaltest dict2opal p2_test valgetopt_ex json_ex sharedmem_test ready_test speed_test pickleloader_test chooseser_test xmldump_test xmldump_ex xmlload_test xmlload_ex xml2dict dict2xml samplehttpserver_ex serverside_ex clientside_ex middleside_ex checkshm_test
and upon building it using make -f Makefile.Linux all, I run into the following error:
g++ -Wall -Wextra -fpic -O -fno-strict-aliasing -DLINUX_ -DOC_NEW_STYLE_INCLUDES -Wno-depr
ecated -I./opencontainers_1_8_5/include -pthread -D_REENTRANT -c m2pythontools.cc
In file included from ./opencontainers_1_8_5/include/ocstreamingpool.h:23,
from ./opencontainers_1_8_5/include/ocarray.h:28,
from m2pythontools.h:8,
from m2pythontools.cc:2:
./opencontainers_1_8_5/include/ocsynchronizer.h:14:10: fatal error: pthread.h: No such fil
e or directory
14 | #include <pthread.h>
| ^~~~~~~~~~~
compilation terminated.
make: *** [MakeFile.Linux:29: m2pythontools.o] Error 1
where line 27-30 is:
.cc.o:
$(CC) $(CFLAGS) -c $<
I've checked my /usr/include directory and found a pthread.h header and there's an ancient thread which mentions that pthread is include in cygwin1.dll and hence one can simply pass -lcygwin. However, that didn't work for me either. I also tried moving the pthread.h file into the directory but still got the same error, I don't know how to proceed.
EDIT: Running echo | cpp -v gives the following output:
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\cpp.exe
Target: mingw32
Configured with: ../src/gcc-9.2.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --t
arget=mingw32 --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-stati
c --enable-shared --enable-threads --enable-languages=c,c++,objc,obj-c++,fortran,ada --wit
h-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libgomp
--disable-libvtv --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libs
tdcxx-debug --disable-build-format-warnings --prefix=/mingw --with-gmp=/mingw --with-mpfr=
/mingw --with-mpc=/mingw --with-isl=/mingw --enable-nls --with-pkgversion='MinGW.org GCC B
uild-20200227-1'
Thread model: win32
gcc version 9.2.0 (MinGW.org GCC Build-20200227-1)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=i586'
c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/cc1.exe -E -quiet -v -iprefix c:\mingw\bin\../l
ib/gcc/mingw32/9.2.0/ - -mtune=generic -march=i586
ignoring nonexistent directory "c:\mingw\bin\../lib/gcc/mingw32/9.2.0/../../../../mingw32/
include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/include"
ignoring nonexistent directory "/mingw/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/include-fixed"
ignoring nonexistent directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/../../../../m
ingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/include
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/../../../../include
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/include-fixed
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/;c:/mingw/bin/../libexec/gcc/;c:/m
ingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/9.2.0/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/
../lib/gcc/mingw32/9.2.0/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/9.2.0/..
/../../
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=i586'
Depending if you are building for Cygwin or for Mingw (from Cygwin)
you need different cygwin packages: cygwin-devel or mingw64-x86_64-winpthreads
$ cygcheck -l mingw64-x86_64-winpthreads | grep /pthread.h
/usr/x86_64-w64-mingw32/sys-root/mingw/include/pthread.h
$ cygcheck -l cygwin-devel | grep /pthread.h
/usr/include/pthread.h
I'm trying to get dlib library working in my C++ project from last 2 weeks and found some solution but still i'm facing errors which i can not understand. As i am newbie to the makefile and dlib guide me what to do with makefile.
The folder structure is like this:
projectDir
|-makefile
|-src
|-CDetector.cpp
|-CDetectot.h
|-CStreamReader.cpp
|-CStreamReader.h
|-include
|-darknet
|-(files).h (other .h files needed by src files)
|-dlib-19.6
|-all
|-source.cpp
|-lots of header files
|-...
|-external_libs
|-libdarknet.a
|-libdarknet.so
The makefile looks like this:
EXE = darknet
OBJ_DIR = obj
CXXFILES = $(shell find src -type f -name '*.cpp')
CXXOBJ = $(patsubst src/%.cpp,obj/%.o,$(CXXFILES))
INCLUDE = -I/include -I/include/darknet
LIBS = external_libs/libdarknet.a
CXXFLAGS = `pkg-config --cflags-only-I opencv` -Wall -Wno-unknown-pragmas -Wfatal-errors -Wwrite-strings -fPIC
LDFLAGS = -lm -pthread -lX11 -DDLIB_JPEG_SUPPORT -ljpeg
all: $(EXE)
$(EXE): $(CXXOBJ)
$(CXX) $(CXXOBJ) -o $(EXE) $(LIBS) $(LDFLAGS)
$(OBJ_DIR)/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE) $< -c -o $#
$(BUILD)
run: all
./$(EXE)
clean:
-rm -f $(EXE) $(CXXOBJ)
rmdir obj/
It needs some modification as INCLUDE, CXXFLAGS AND LDFLAGS will be
INCLUDE = -Iinclude -Iinclude/darknet `pkg-config --cflags-only-I opencv`
CXXFLAGS = -Wall -Wno-unknown-pragmas -Wfatal-errors -Wwrite-strings -fPIC
LDFLAGS = -lm -pthread -lX11 -DDLIB_JPEG_SUPPORT -ljpeg -lopencv_videoio `pkg-config --libs opencv`
and i'm now using darknet makefile to do it so my makefile looks like
VPATH = ./src/
ALIB = external_libs/libdarknet.a
EXEC = darknet
OBJDIR = ./obj/
CC = g++ -std=c++11
NVCC = nvcc
AR = ar
ARFLAGS = rcs
OPTS = -Ofast
LDFLAGS = -lm -pthread -lX11 -DDLIB_JPEG_SUPPORT -ljpeg -lopencv_videoio `pkg-config --libs opencv`
INCLUDE = -Iinclude -Iinclude/darknet `pkg-config --cflags-only-I opencv`
CFLAGS = -Wall -Wno-unknown-pragmas -Wfatal-errors -Wwrite-strings -fPIC
OBJ = CDetector.o CStreamReader.o
EXECOBJA = CDetector.o CStreamReader.o
EXECOBJ = $(addprefix $(OBJDIR), $(EXECOBJA))
OBJS = $(addprefix $(OBJDIR), $(OBJ))
DEPS = $(wildcard src/*.h) Makefile include/darknet/darknet.h
all: obj results $(ALIB) $(EXEC)
$(EXEC): $(EXECOBJ) $(ALIB)
$(CC) $(INCLUDE) $(CFLAGS) $^ -o $# $(LDFLAGS) $(ALIB)
$(ALIB): $(OBJS)
$(AR) $(ARFLAGS) $# $^
$(OBJDIR)%.o: %.cpp $(DEPS)
$(CC) $(INCLUDE) $(CFLAGS) -c $< -o $#
obj:
mkdir -p obj
backup:
mkdir -p backup
results:
mkdir -p results
.PHONY: clean
clean:
rm -rf $(OBJS) $(ALIB) $(EXEC) $(EXECOBJ)
I am trying to compile Indri 5.9 (downloaded from http://sourceforge.net/projects/lemur/) on Ubuntu 14.04 LTS using VirtualBox, but after "env CPP=/usr/bin/cpp CXX=/usr/bin/g++ ./configure" and when I "make", I got a problem: ator.cpp:216:undefined reference to 'gzopen'. I already installed zlib1g0dev by "sudo apt-get install zlib1g-dev", and according to Compilation problems with ZLIB it seems I have to add "-lz" at the end of "-o". However, this is my Makefile:
-include MakeDefns
INSTALLDIRS = $(bindir) $(includedir) $(pkgincludedir) $(includedir)/lemur $(libdir) $(pkgdatadir) $(pkgdatadir)/doc
.PHONY: all dist clean install $(INSTALLDIRS) site-search
all:
$(MAKE) -C contrib
$(MAKE) -C obj -f ../src/Makefile
ifeq ($(WITH_SWIG), 1)
$(MAKE) -C swig/src
endif
$(MAKE) -C buildindex
$(MAKE) -C runquery
$(MAKE) -C indrid
$(MAKE) -C dumpindex
$(MAKE) -C harvestlinks
$(MAKE) -C pagerank
$(MAKE) -C rmodel
$(MAKE) -C makeprior
$(MAKE) -C site-search
$(MAKE) -C modifyfields
$(MAKE) -C clarity
$(MAKE) -C reformulate
$(INSTALLDIRS):
$(INSTALL_DIR) $#
clean:
$(MAKE) clean -C contrib
$(MAKE) clean -C obj -f ../src/Makefile
ifeq ($(WITH_SWIG), 1)
$(MAKE) clean -C swig/src
endif
$(MAKE) clean -C buildindex
$(MAKE) clean -C runquery
$(MAKE) clean -C indrid
$(MAKE) clean -C dumpindex
$(MAKE) clean -C harvestlinks
$(MAKE) clean -C pagerank
$(MAKE) clean -C rmodel
$(MAKE) clean -C makeprior
$(MAKE) -C site-search clean
$(MAKE) -C modifyfields clean
$(MAKE) -C clarity clean
$(MAKE) -C reformulate clean
rm -f depend/*
distclean: clean
rm -rf autom4te.cache MakeDefns Makefile.app config.log config.status indri.ncb indri.suo
dist: distclean
$(MAKE) stamp -C obj -f ../src/Makefile
cd ..; tar zcvf indri-`date +%Y%m%d-%H%M`.tar.gz indri
install: $(INSTALLDIRS)
rm -f $(libdir)/$(INDRILIB)
$(MAKE) install -C contrib
$(MAKE) install -C obj -f ../src/Makefile
ifeq ($(WITH_SWIG), 1)
$(MAKE) install -C swig/src
endif
$(MAKE) install -C buildindex
$(MAKE) install -C runquery
$(MAKE) install -C indrid
$(MAKE) install -C dumpindex
$(MAKE) install -C harvestlinks
$(MAKE) install -C pagerank
$(MAKE) install -C rmodel
$(MAKE) install -C makeprior
$(MAKE) install -C modifyfields
$(MAKE) install -C clarity
$(MAKE) install -C reformulate
$(MAKE) install -C doc
$(MAKE) -C site-search install
$(INSTALL_DATA) Makefile.app $(pkgdatadir)
test:
And this is MakeDefns:
SHELL = /bin/bash
host_os = linux-gnu
srcdir = .
top_srcdir = .
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${datarootdir}
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${datarootdir}/info
mandir = ${datarootdir}/man
includedir = ${prefix}/include
datarootdir = ${prefix}/share
oldincludedir = /usr/include
pkgdatadir = $(datadir)/indri
pkglibdir = $(libdir)/indri
pkgincludedir = $(includedir)/indri
top_builddir = .
AR = /usr/bin/ar
CC = gcc
GCC_33 = 0
CXX = /usr/bin/g++
LEX = :
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DIR = ${INSTALL} -m 755 -d
JAVAC =
JAR =
JAVAINC =
JAVADOC =
JAVAHOME =
NEED_ANTLR = 1
SWIG =
PHP_SHARED = -shared
JAVA_SHARED = -shared
CSHARP_SHARED = -shared
PHP_SO = .so
JAVA_SO = .so
CSHARP_SO = .so
PHPINCLUDE =
MCS=
DEPENDENCIES = lemur xpdf
ifeq ($(NEED_ANTLR), 1)
DEPENDENCIES += antlr
endif
PACKAGE = indri
VERSION = 5.8
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
INDRI_STANDALONE = 1
INDRILIB = lib$(PACKAGE).a
WITH_SWIG = 0
WITH_JAVA = 0
WITH_PHP = 0
WITH_CSHARP = 0
# C++ source files
CPPSRC1 = $(notdir $(wildcard ../src/*.cpp))
CPPSRC2 = $(notdir $(wildcard ../src/*.cc))
CPPSRC3 = $(notdir $(wildcard ../src/*.C))
# C source files
CSRC = $(notdir $(wildcard ../src/*.c))
# flex source files
FSRC = $(notdir $(wildcard ../src/*.l))
# Flex objects
FCPP = $(filter-out $(CPPSRC1), $(FSRC:.l=.cpp))
CPPSRC = $(CPPSRC1) $(CPPSRC3) $(CPPSRC3) $(FCPP)
.SECONDARY: $($(wildcard ../src/*.l).l=.cpp)
# All header files
ALLHEADER = $(wildcard ../include/indri/*.h*)
# Include path
INCPATH = -I../include $(patsubst %, -I../contrib/%/include, $(DEPENDENCIES))
ALLINCPATH = $(INCPATH)
# C++ objects
CPPOBJ = $(CPPSRC:.cpp=.o) $(CPPSRC2:.cc=.o) $(CPPSRC3:.C=.o)
# C objects
COBJ = $(CSRC:.c=.o)
# all objects
OBJ = $(CPPOBJ) $(COBJ)
# application makefiles should set SHARED=
# (see buildindex/Makefile
SHARED = -shared -fPIC
# C compiler and compiling options
# C++ compiler and compiling/linking options
CFLAGS = -DPACKAGE_NAME=\"Indri\" -DPACKAGE_TARNAME=\"indri\" -DPACKAGE_VERSION=\"5.8\" -DPACKAGE_STRING=\"Indri\ 5.8\" -DPACKAGE_BUGREPORT=\"project#lemurproject.org\" -DINDRI_STANDALONE=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_NAMESPACES=/\*\*/ -DISNAN_IN_NAMESPACE_STD=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DNDEBUG=1 -g -O3 $(INCPATH) $(SHARED)
CXXFLAGS = -DPACKAGE_NAME=\"Indri\" -DPACKAGE_TARNAME=\"indri\" -DPACKAGE_VERSION=\"5.8\" -DPACKAGE_STRING=\"Indri\ 5.8\" -DPACKAGE_BUGREPORT=\"project#lemurproject.org\" -DINDRI_STANDALONE=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_NAMESPACES=/\*\*/ -DISNAN_IN_NAMESPACE_STD=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DNDEBUG=1 -g -O3 $(INCPATH) $(SHARED)
CXXFLAGS_NOOPT = -DPACKAGE_NAME=\"Indri\" -DPACKAGE_TARNAME=\"indri\" -DPACKAGE_VERSION=\"5.8\" -DPACKAGE_STRING=\"Indri\ 5.8\" -DPACKAGE_BUGREPORT=\"project#lemurproject.org\" -DINDRI_STANDALONE=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_NAMESPACES=/\*\*/ -DISNAN_IN_NAMESPACE_STD=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DNDEBUG=1 -g $(INCPATH) $(SHARED)
CPPLDFLAGS = -lpthread -lm
ifeq ($(STYLE),release)
CFLAGS = -DPACKAGE_NAME=\"Indri\" -DPACKAGE_TARNAME=\"indri\" -DPACKAGE_VERSION=\"5.8\" -DPACKAGE_STRING=\"Indri\ 5.8\" -DPACKAGE_BUGREPORT=\"project#lemurproject.org\" -DINDRI_STANDALONE=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_NAMESPACES=/\*\*/ -DISNAN_IN_NAMESPACE_STD=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DNDEBUG=1 -DNDEBUG -g -O3 $(INCPATH) $(SHARED)
CXXFLAGS = -DPACKAGE_NAME=\"Indri\" -DPACKAGE_TARNAME=\"indri\" -DPACKAGE_VERSION=\"5.8\" -DPACKAGE_STRING=\"Indri\ 5.8\" -DPACKAGE_BUGREPORT=\"project#lemurproject.org\" -DINDRI_STANDALONE=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_NAMESPACES=/\*\*/ -DISNAN_IN_NAMESPACE_STD=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FSEEKO=1 -DHAVE_EXT_ATOMICITY_H=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DNDEBUG=1 -DNDEBUG -g -O3 $(INCPATH) $(SHARED)
CPPLDFLAGS = -lpthread -lm
endif
ifeq ($(STYLE),profile)
CFLAGS=-g -pg $(INCPATH)
CXXFLAGS=-g -pg $(INCPATH)
endif
# generating C++ with flex
../src/%.cpp: ../src/%.l
$(LEX) -8 -Cf -o$# $<
I am new to Makefile, so could anyone help me on how to add "-lz" to it? Or any other suggestions for compiling Indri 5.9. Thanks a lot!