Hi,
I am new to this list and to mysql++. I am hoping it will help me tonnes in
my projects.
I am using mysql++ on a windows XP home virtual machine. I have complied the
library and sucessfully run the demo apps (including resetdb, etc.) I am
compiling with g++ and using MinGW.
I have also compiled my own test app and it works correctly.
The only problem is I wish to link the library into my program so I do not
have to distribute a seperate dll file.
Is this possible?
I note that after running install.hta I have two files in my lib directory:
libmysqlpp.a
and mysqlpp.dll
The following command works fine for me:
g++
-s C:\devl\units\mysql\test_prog.cpp
-o C:\devl\units\mysql\DEBUG/main.exe
-I"C:\devl\units\mysql\mysql++"/include
-I"C:\Program Files\MySQL\MySQL Server 5.1"/include
-L"C:\Program Files\MySQL\MySQL Server 5.1"/lib/opt
-L"C:\devl\units\mysql\mysql++"/lib
-lmysqlpp
-lmysqlclient
All commands run from the command prompt (Start->Run->cmd)
I end up with a probram called main.exe that relies on mysqlpp.dll to be
somewhere in the path to run. Everything runs fine.
I guessed that linking against libmysqlpp.a would result in a .exe that
dosn't require the .dll to work. I have run the following command:
g++ -s C:\devl\units\mysql\test_prog.cpp
-o C:\devl\units\mysql\DEBUG/main.exe
-I"C:\devl\units\mysql\mysql++"/include
-I"C:\Program Files\MySQL\MySQL Server 5.1"/include
-L"C:\Program Files\MySQL\MySQL Server 5.1"/lib/opt
-L"C:\devl\units\mysql\mysql++"/lib
-llibmysqlpp
-lmysqlclient
and I get the message:
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot
find -llibmysqlpp
I tried adding the .a extension
g++ -s C:\devl\units\mysql\test_prog.cpp
-o C:\devl\units\mysql\DEBUG/main.exe
-I"C:\devl\units\mysql\mysql++"/include
-I"C:\Program Files\MySQL\MySQL Server 5.1"/include
-L"C:\Program Files\MySQL\MySQL Server 5.1"/lib/opt
-L"C:\devl\units\mysql\mysql++"/lib
-llibmysqlpp.a
-lmysqlclient
The error:
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot
find -llibmysqlpp.a
Finally to test paths I tred:
g++ -s C:\devl\units\mysql\test_prog.cpp
-o C:\devl\units\mysql\DEBUG/main.exe
-I"C:\devl\units\mysql\mysql++"/include -I"C:\Program Files\MySQL\MySQL
Server 5.1"/include
-L"C:\Program Files\MySQL\MySQL Server 5.1"/lib/opt
-L"C:\devl\units\mysql\mysql++"/lib
-lmysqlpp.dll
-lmysqlclient
This gave another error.
In case it's impotant g++ -v gives:
C:\Documents and Settings\Robert>g++ -v
Reading specs from C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld
--wi
th-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads
--dis
able-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry
--d
isable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt
--with
out-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter
--enabl
e-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)
I understand this is the correct version of g++.
I would be grateful for any help anyone on here can provide.
Why dosn't mysqlpp work but mysqlpp.dll dosn't?
Should I link to libmysqlpp to get a non dll version?
Thanks
Robert
-------------------------
Robert Metcalf
robert@stripped