Re: Need help with Makefile for static c++ connector
Posted by:
Luis Silva
Date: September 21, 2021 04:46AM
The packages might have influence, since it can be built with different/imcompatible g++ version / std++ lib.
So you should use the ubuntu 20.04 package.
With them installed on system, this Makefile works:
root@adcae8f97ae7:~/build# cat Makefile
CC = g++
CFLAGS = -g -Wall -O0 -std=c++17
CPPFLAGS = -DCPPCONN_PUBLIC_FUNC= -I /usr/include/mysql-cppconn-8/
LDFLAGS = -lmysqlcppconn-static -lssl -lcrypto -lpthread -ldl -lresolv
SOURCES = main.cc
OBJECTS = $(SOURCES:.c=.o)
TARGET = mysqltest
$(TARGET) : $(OBJECTS)
$(CC) $(CPPFLAGS) ${CPPFLAGS} -o $@ $^ $(LDFLAGS)
.PHONY: clean
clean:
@rm -f $(TARGET) $(OBJECTS) core
Subject
Views
Written By
Posted
1078
September 06, 2021 04:22PM
493
September 10, 2021 10:10AM
603
September 18, 2021 07:21PM
474
September 20, 2021 03:36AM
497
September 20, 2021 07:40PM
Re: Need help with Makefile for static c++ connector
542
September 21, 2021 04:46AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.