I have used this type of decleration many, many, many times in C++ and C# for Windows. For some reason gcc-c++ has a problem with the scope of the variable. What can I do with this? Thank you to all you kind souls that answer all my dumb questions. Merry Christmas!
login as: root
root@184.106.180.133's password:
Last login: Tue Dec 21 01:49:27 2010 from cpe-76-172-220-236.socal.res.rr.com
[root@dsgfedora01 ~]# cd ..
[root@dsgfedora01 /]# ls
bin boot cgroup dev dsgsports etc home lib lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var
[root@dsgfedora01 /]# cd dsgsports
[root@dsgfedora01 dsgsports]# ls
downloadtribune downloadtribune.cpp loaddsgsports loaddsgsports.cpp
[root@dsgfedora01 dsgsports]# g++ -I/usr/include/mysql -I/usr/include/mysql++ -lmysqlpp -L/usr/lib/mysql -L/usr/local/lib/mysql++ loaddsgsports.cpp -o loaddsgsports
loaddsgsports.cpp: In function âint main()â:
loaddsgsports.cpp:108:20: error: âoutputâ was not declared in this scope
[root@dsgfedora01 dsgsports]#
int main()
{
mysqlpp::Connection conn(false);
if (conn.connect("dsgsports","127.0.0.1" , "root", "")) {
printf("Connected to database.\n");
}
else {
printf("Failed to connect to database.");