@@ -61,7 +61,13 @@ sudo make install #generate lib files and put them in /usr/lib(maybe)
61
61
62
62
Before you compile nanodbc, you should download UnixOdbc:
63
63
64
- ### download unixODBC-2.3.0.tar.gz
64
+ ### download mariadb and configure
65
+
66
+ ### download unixodbc
67
+
68
+ ` sudo apt install unixodbc `
69
+
70
+ ### download unixODBC-2.3.0.tar.gz -> to download odbc_config
65
71
66
72
Download unixODBC-2.3.0.tar.gz ,you can also use ` sudo apt install unixodbc ` to download but it's unuseful to my system
67
73
@@ -84,7 +90,6 @@ odbc_config --version #check odbc_config is installed
84
90
{
85
91
` sudo apt install odbc-mariadb `
86
92
87
- <font size =16 > TO BE CONTINUED!!!! </font >
88
93
}
89
94
90
95
### configure odbc-mariadb
@@ -102,8 +107,6 @@ git clone <https://github.com/nanodbc/nanodbc.git> #download nanodbc
102
107
103
108
cd nanodbc # change to nanodbc dir
104
109
105
- cp -r nanodbc ../cids-servser/include # copy include file to projectPath/include
106
-
107
110
mkdir build # Put compiler output in build file
108
111
109
112
cd build # change to build dir
@@ -112,8 +115,21 @@ cmake .. #generate Makefile
112
115
113
116
make # generate other things you can add '-j4' after 'make' to make it faster
114
117
115
- cp libnanodbc.a ../../cids-servers/lib # copy library file to projectPath/lib
118
+ sudo make install # add lib to your env
119
+
116
120
```
121
+ add these statements to your CMakeLists.txt
122
+
123
+ ``` cmake
124
+ if (NOT TARGET nanodbc)
125
+ find_package(nanodbc CONFIG REQUIRED)
126
+ endif()
127
+
128
+ #add exe here
129
+
130
+ target_link_libraries(SRC nanodbc)
131
+
132
+
117
133
118
134
------
119
135
0 commit comments