Skip to content

Commit a30a4a2

Browse files
Update README.md
update odbc lib
1 parent 1d7e3e4 commit a30a4a2

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ sudo make install #generate lib files and put them in /usr/lib(maybe)
6161

6262
Before you compile nanodbc, you should download UnixOdbc:
6363

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
6571

6672
Download unixODBC-2.3.0.tar.gz ,you can also use `sudo apt install unixodbc ` to download but it's unuseful to my system
6773

@@ -84,7 +90,6 @@ odbc_config --version #check odbc_config is installed
8490
{
8591
`sudo apt install odbc-mariadb`
8692

87-
<font size=16> TO BE CONTINUED!!!! </font>
8893
}
8994

9095
### configure odbc-mariadb
@@ -102,8 +107,6 @@ git clone <https://github.com/nanodbc/nanodbc.git> #download nanodbc
102107

103108
cd nanodbc #change to nanodbc dir
104109

105-
cp -r nanodbc ../cids-servser/include #copy include file to projectPath/include
106-
107110
mkdir build #Put compiler output in build file
108111

109112
cd build #change to build dir
@@ -112,8 +115,21 @@ cmake .. #generate Makefile
112115

113116
make #generate other things you can add '-j4' after 'make' to make it faster
114117

115-
cp libnanodbc.a ../../cids-servers/lib #copy library file to projectPath/lib
118+
sudo make install #add lib to your env
119+
116120
```
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+
117133
118134
------
119135

0 commit comments

Comments
 (0)