Back to the main page.
Bug 1337 - typo bug and wrong path
Status | CLOSED FIXED |
Reported | 2012-02-22 11:55:00 +0100 |
Modified | 2012-06-20 15:03:24 +0200 |
Product: | FieldTrip |
Component: | realtime |
Version: | unspecified |
Hardware: | Macintosh |
Operating System: | Mac OS |
Importance: | P3 minor |
Assigned to: | Boris Reuderink |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Philip van den Broek - 2012-02-22 11:55:25 +0100
Compiling com2event failed on OSX because of a typo bug in serial_event.c and wrong relative path names used in the makefile. In serial_event: line 406 variable 's' should be 'sock': change if (fcntl(s, F_SETFL, optval)<0) { to if (fcntl(sock, F_SETFL, optval)<0) { Fix the relative path names in the makefile (com2event folder): Instead of ../buffer/... use ../../buffer/... The entire makefile file is given below: # Copyright (C) 2010 Stefan Klanke # Donders Institute for Donders Institute for Brain, Cognition and Behaviour, # Centre for Cognitive Neuroimaging, Radboud University Nijmegen, # Kapittelweg 29, 6525 EN Nijmegen, The Netherlands # Use MinGW for compilation on Windows! # NOTE: make sure bug is fixed in serial_event.c, line 406 variable 's' should be 'sock' PLATFORM = $(shell gcc -dumpmachine) ifeq "$(PLATFORM)" "mingw32" LDFLAGS = pthreadGC2.dll ../../buffer/src/libbuffer.a -LC:/msys/1.0/local/lib -lws2_32 -lwinmm ADDINC = -I../../buffer/pthreads-win32/include SUFFIX = .exe else LDFLAGS = -lpthread ../../buffer/src/libbuffer.a ADDINC = SUFFIX = endif CFLAGS = -I../../buffer/src -I. $(ADDINC) -Wunused -Wall -pedantic all: serial_event$(SUFFIX) ############################################################################### # Platform-independent C libraries / utilities ############################################################################### serial.o: serial.c serial.h gcc -c serial.c -I. ############################################################################### # Platform-independent applications ############################################################################### serial_event.o: serial_event.c serial.h gcc -c serial_event.c $(CFLAGS) -I../../buffer/src/ serial_event$(SUFFIX): serial_event.o serial.o gcc -o serial_event$(SUFFIX) serial_event.o serial.o $(LDFLAGS)
Boris Reuderink - 2012-02-29 14:44:25 +0100
What a 133t bug :). I have committed your changes in revision 5330, and it indeed fixes a broken build (see bug 1346). Thank you. Best, Boris --- BTW, if you work with the SVN version, the made changes can saved to a patch with: $ svn diff > patch.diff which I can then apply with something like: $ patch -p0 -i patch.diff That might be more convenient.