Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

Segmentation Fault on Example Program (no replies)

$
0
0
I am using Mac OS X Yosemite version 10.10.5. I downloaded the connector/c++ library from the mysql developer website. I untared the files and installed them in /usr/local/mysql-connector-c++-1.1.6-osx10.8-x86-64bit. I created a simple makefile. Everything compiles and links fine, but when I run it, I get a segmentation fault 11. Why?

#locations to library directories
CONNECTOR_C_PATH = /usr/local/mysql-connector-c-6.1.6-osx10.8-x86_64
CONNECTOR_CPP_PATH = /usr/local/mysql-connector-c++-1.1.6-osx10.8-x86-64bit
BOOST_PATH = /usr/local/Cellar/boost/1.58.0

#specific configuration for this build
INCLUDE_PATHS = -I $(CONNECTOR_CPP_PATH)/include -I $(BOOST_PATH)/include
LIB_PATHS = -L $(CONNECTOR_CPP_PATH)/lib -L $(BOOST_PATH)/lib
LIBS = -l mysqlcppconn
COMPILE_OPTS = $(INCLUDE_PATHS) 
LINK_OPTS = $(LIB_PATHS) $(LIBS)
CPP = g++
COMPILE = $(CPP) $(COMPILE_OPTS) -c
LINK = $(CPP) $(LINK_OPTS) -o

all: sqltest

# Create the server
sqltest: main.o 
	 $(LINK) sqltest main.o

main.o: main.cpp
	$(COMPILE) main.cpp

clean:
	-rm *.o sqltest

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>