Hi,

syslogparse.go
-----------------------

***************************************

package lib

//#cgo CFLAGS: -I./syslog-ng-3.6.2/
//#cgo LDFLAGS: syslog-node.so.  <<<<<<<<<<<<<<<<<
//#cgo LDFLAGS: -L/usr/local/lib/ -lsyslog-ng
//#cgo LDFLAGS: -L/usr/local/lib/syslog-ng -ldbparser
//#cgo pkg-config: syslog-ng
//#cgo pkg-config: eventlog
//void callOnMeGo_cgo(char *key, char *value, size_t value_len);// Forward 
Declaration.
//#include "../syslog-node1.h"
import "C"

import (
"PAS/config"
"PAS/constants"
"fmt"
"unsafe"
)
*******************************************************
makefile
------------
******************************

.PHONY: all clean

all: main

main: syslog-node.so main.go syslog-node1.h
go build -v -x main.go

syslog-node.so: syslog-node.c syslog-node1.h
gcc -L/usr/local/lib -lsyslog-ng -o syslog-node.so 
-L/usr/local/lib/syslog-ng -ldbparser -c `pkg-config --libs --cflags 
glib-2.0` -I/usr/local/include/syslog-ng/ -I./syslog-ng-3.6.2/ -I. 
-I/usr/local/include/eventlog/ syslog-node.c

clean:
rm aws_utils
rm syslog-node.so

********************************************************

syslogparse.go is present in the lib directory (that is different from 
current directory).
My main.go is present in the current directory.My syslog-node.so gets 
created in the current directory.Makefile is present in the current 
directory
While running the make command I get then following error in the step 'go 
build -v -x main.go':

go build -v -x main.go
WORK=/tmp/go-build133367384
PAS/lib
mkdir -p $WORK/b128/
cd /home/nsaboo/Documents/goworkspace/src/PAS/lib
pkg-config --cflags -- syslog-ng eventlog
pkg-config --libs -- syslog-ng eventlog
CGO_LDFLAGS='"-g" "-O2" "syslog-node.so" "-L/usr/local/lib/" "-lsyslog-ng" 
"-L/usr/local/lib/syslog-ng" "-ldbparser" "-L/usr/local/lib" 
"-Wl,--export-dynamic" "-lgmodule-2.0" "-pthread" "-lgthread-2.0" 
"-pthread" "-lglib-2.0" "-lsyslog-ng" "-lglib-2.0" "-levtlog"' 
/usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b128/ -importpath 
PAS/lib -- -I/usr/local/include/syslog-ng 
-I/usr/local/include/syslog-ng/ivykis -I/usr/local/include/eventlog 
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I 
$WORK/b128/ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 
./cfuncs.go ./syslogparser.go
cd $WORK
gcc -fno-caret-diagnostics -c -x c - || true
gcc -Qunused-arguments -c -x c - || true
gcc -fdebug-prefix-map=a=b -c -x c - || true
gcc -gno-record-gcc-switches -c -x c - || true
cd $WORK/b128
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC 
-m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches 
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis 
-I/usr/local/include/eventlog -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o 
./_x001.o -c _cgo_export.c
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC 
-m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches 
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis 
-I/usr/local/include/eventlog -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o 
./_x002.o -c cfuncs.cgo2.c
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC 
-m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches 
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis 
-I/usr/local/include/eventlog -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o 
./_x003.o -c syslogparser.cgo2.c
TERM='dumb' gcc -I /home/nsaboo/Documents/goworkspace/src/PAS/lib -fPIC 
-m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches 
-I/usr/local/include/syslog-ng -I/usr/local/include/syslog-ng/ivykis 
-I/usr/local/include/eventlog -I/usr/include/glib-2.0 
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ./ -g -O2 
-I/home/nsaboo/Documents/goworkspace/src/PAS/lib/syslog-ng-3.6.2 -o 
./_cgo_main.o -c _cgo_main.c
cd /home/nsaboo/Documents/goworkspace/src/PAS/lib
TERM='dumb' gcc -I . -fPIC -m64 -pthread -fmessage-length=0 
-fdebug-prefix-map=$WORK/b128=/tmp/go-build -gno-record-gcc-switches -o 
$WORK/b128/_cgo_.o $WORK/b128/_cgo_main.o $WORK/b128/_x001.o 
$WORK/b128/_x002.o $WORK/b128/_x003.o -g -O2 syslog-node.so 
-L/usr/local/lib/ -lsyslog-ng -L/usr/local/lib/syslog-ng -ldbparser 
-L/usr/local/lib -Wl,--export-dynamic -lgmodule-2.0 -pthread -lgthread-2.0 
-pthread -lglib-2.0 -lsyslog-ng -lglib-2.0 -levtlog
# PAS/lib
gcc: error: syslog-node.so: No such file or directory
makefile:6: recipe for target 'main' failed
make: *** [main] Error 2


I feel syslog-node.so is getting created at a location which 
syslogparser.so is not able to identify.
Can someone please guide me on this issue ?

Thanks,
Nitish

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/54610dcd-ae9e-487e-96ce-efc3e3c5f039%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to