Re: [Dclib-devel] Linux makefile
Brought to you by:
davisking
From: Davis K. <dav...@us...> - 2014-05-21 23:16:46
|
It's not working because you disabled exceptions and are getting errors on lines of code that deal in exceptions. You can see this in your first compiler error message: /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/threads_kernel_2.h:51:17: error: exception handling disabled, use -fexceptions to enable In your makefile you have -fno-exceptions set. If you take that out it should work fine. Cheers, Davis On Wed, May 21, 2014 at 1:07 PM, Martin Fabichak <mfa...@gm...> wrote: > Hi guys! > > I'm writing a cross-platform code and need to use dlib. > In windows, I added the source.cpp file and added the dlib folder to my > project include path and everything worked. > > I needed to compile the same result in windows, But I can't! > > This is the makefile I'm using (generated by shiva3D). > > If I add the folder D_LIB with -I$(DLIB) in CFLAGS, results in the errors on > the end of the email. I'm pretty sure the error is caused by me not adding > the source.cpp here. I'm really lost, can someone help me? > > > ################################################################# > # ShiVa Extension Plugin Makefile for Linux > ################################################################# > > TEMP_DIR = ../../Temp/Linux > SRCROOT = ../../Sources > S3DXROOT = ../../Sources/S3DX > BUILT_PRODUCTS_DIR = ../../Contents/Linux > PRODUCT_NAME = ludiumTest_Linux.so > D_SOURCE = /dlib-18.7/dlib/all > D_LIB = /dlib-18.7/ > BOOST_LIB = /boost/boost_1_55_0/stage/libs/ > ################################################################# > SOURCES = Plugin.cpp ludium.cpp > > ################################################################# > # Compiler executables > # > CC = gcc > CPP = g++ > LD = $(CPP) > > ####################################################################" > # Compiler flags > # > CFLAGS = -Os -Wno-unknown-pragmas -fsigned-char -fno-exceptions > -DS3DX_DLL -D__LINUX__ -D_GNU_SOURCE -DHAVE_STDINT_H -I$(D_LIB) > -I$(SRCROOT)/Linux -I$(S3DXROOT) > CPPFLAGS = > LDFLAGS = > > ####################################################################" > # Objects > # > OBJECTS = \ > $(patsubst %.c,%.o,$(filter %.c,$(SOURCES))) \ > $(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES))) \ > $(patsubst %.cpp,%.o,$(filter %.cpp,$(SOURCES))) > > OBJECTS_ABS = $(addprefix $(TEMP_DIR)/,$(OBJECTS)) > PRODUCT_ABS = $(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME) > > ####################################################################" > # Rules > # > > $(TEMP_DIR)/%.o: $(SRCROOT)/%.c > mkdir -p `dirname $@` > $(CC) $(CFLAGS) -c $< -o $@ > > $(TEMP_DIR)/%.o: $(SRCROOT)/%.cpp > mkdir -p `dirname $@` > $(CPP) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ > > ####################################################################" > # Targets > # > all: $(PRODUCT_ABS) > > $(PRODUCT_ABS): $(OBJECTS_ABS) > mkdir -p $(BUILT_PRODUCTS_DIR) > $(LD) -shared -o $(PRODUCT_ABS) $(OBJECTS_ABS) $(LDFLAGS) > > clean: > rm -f $(PRODUCT_ABS) $(OBJECTS_ABS) > > ####################################################################" > > > > ERRORS: > > g++ -Os -Wno-unknown-pragmas -fsigned-char -fno-exceptions -DS3DX_DLL > -D__LINUX__ -D_GNU_SOURCE -DHAVE_STDINT_H -I/dlib-18.7/ > -I../../Sources/Linux -I../../Sources/S3DX -c ../../Sources/ludium.cpp -o > ../../Temp/Linux/ludium.o > In file included from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/posix.h:4:0, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/threads_kernel.h:13, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads.h:6, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/sockets_kernel_2.h:33, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/posix.h:4, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets.h:14, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/sockstreambuf.h:8, > from /dlib-18.7/dlib/iosockstream/../sockstreambuf.h:6, > from /dlib-18.7/dlib/iosockstream/iosockstream.h:9, > from /dlib-18.7/dlib/iosockstream.h:6, > from ../../Sources/ludium.cpp:6: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/threads_kernel_2.h: > In constructor ‘dlib::mutex::mutex()’: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/threads_kernel_2.h:51:17: > error: exception handling disabled, use -fexceptions to enable > ); > ^ > In file included from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/binary_search_tree_kernel_1.h:11:0, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree.h:7, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/threads_kernel_shared.h:10, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/threads_kernel_2.h:173, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/posix.h:4, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/threads_kernel.h:13, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads.h:6, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/sockets_kernel_2.h:33, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/posix.h:4, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets.h:14, > from > /dlib-18.7/dlib/iosockstream/../sockstreambuf/sockstreambuf.h:8, > from /dlib-18.7/dlib/iosockstream/../sockstreambuf.h:6, > from /dlib-18.7/dlib/iosockstream/iosockstream.h:9, > from /dlib-18.7/dlib/iosockstream.h:6, > from ../../Sources/ludium.cpp:6: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h: > In function ‘void dlib::serialize(const string&, std::ostream&)’: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h:1038:39: > error: request for member ‘info’ in ‘dlib::e’, which is of non-class type > ‘const double’ > { throw serialization_error(e.info + "\n while serializing object > of type std::string"); } > ^ > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h: > In function ‘void dlib::deserialize(std::string&, std::istream&)’: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h:1052:39: > error: request for member ‘info’ in ‘dlib::e’, which is of non-class type > ‘const double’ > { throw serialization_error(e.info + "\n while deserializing > object of type std::string"); } > ^ > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h: > In function ‘void dlib::serialize(const wstring&, std::ostream&)’: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h:1072:39: > error: request for member ‘info’ in ‘dlib::e’, which is of non-class type > ‘const double’ > { throw serialization_error(e.info + "\n while serializing object > of type std::wstring"); } > ^ > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h: > In function ‘void dlib::deserialize(std::wstring&, std::istream&)’: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h:1087:39: > error: request for member ‘info’ in ‘dlib::e’, which is of non-class type > ‘const double’ > { throw serialization_error(e.info + "\n while deserializing > object of type std::wstring"); } > ^ > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h: > In function ‘void dlib::serialize(const ustring&, std::ostream&)’: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h:1106:39: > error: request for member ‘info’ in ‘dlib::e’, which is of non-class type > ‘const double’ > { throw serialization_error(e.info + "\n while serializing object > of type ustring"); } > ^ > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h: > In function ‘void dlib::deserialize(dlib::ustring&, std::istream&)’: > /dlib-18.7/dlib/iosockstream/../sockstreambuf/../sockets/../threads/../binary_search_tree/../serialize.h:1121:39: > error: request for member ‘info’ in ‘dlib::e’, which is of non-class type > ‘const double’ > { throw serialization_error(e.info + "\n while deserializing > object of type ustring"); } > ^ > make: *** [../../Temp/Linux/ludium.o] Error 1 > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. > Get unparalleled scalability from the best Selenium testing platform > available > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Dclib-devel mailing list > Dcl...@li... > https://lists.sourceforge.net/lists/listinfo/dclib-devel > |