Where should I start? (2D Game Programming)

Started by
18 comments, last by Sareefbadmaash 9 years, 8 months ago


The easiest way to use MySQL from C++ is probably through the connector

I've tried the connector countless times in the past, all I get is errors. Then when I ask for help, people just point to the documentation, and tell me to read it. I don't have time to read the documentation. I read it anyways, and it was still a waste of time because I never got my problem solved.

Advertisement

If you come here to ask something, people give you advice in there own free time,

but it seems a bit that you don't want to listen to them and that you know it better.

My advice for the rest of your life is: Open your mind for advice from other people. In that way you'll become way smarter!

So you better take this advice.

Good luck with your project.


The easiest way to use MySQL from C++ is probably through the connector

I've tried the connector countless times in the past, all I get is errors. Then when I ask for help, people just point to the documentation, and tell me to read it. I don't have time to read the documentation. I read it anyways, and it was still a waste of time because I never got my problem solved.

Okay, well I have used the connector successfully in multiple projects, so I can tell you it works. I did ask you what problems you are having, but you did not answer me.

Also, you don't have time to read the docs? Seriously, with that attitude you won't get far with game programming. It takes time, lots of it.

Now, what was the exact problem?

If you come here to ask something, people give you advice in there own free time,
but it seems a bit that you don't want to listen to them and that you know it better.

Wow, that's a broad statement xD I never even stated anything as if I know anything better. I even admitted I can't code very well in C++, I'm a newb here. Please, before prosecuting me take a look at my past messages. I've never stated that I know more than ANYONE here. Thank you.

Okay, well I have used the connector successfully in multiple projects, so I can tell you it works. I did ask you what problems you are having, but you did not answer me.

?
Well one problem I have noticed is that I am using VS2013, and it says in the MySQL C++ Connector docs that I have to use the outdated 2008 IDE which is fairly retarded. I don't understand why I should have to downgrade my IDE in order to use something that should work fine since it's still the same language. (MicroSoft problems am I right?)

As for my actual problems, here is my code (which is an actual sample code from their website and should work by default):

#include <mysql_connection.h>
#include <mysql_driver.h>
#include <mysql_error.h>
int main(){
sql::mysql::MySQL_Driver *driver;
sql::Connection *con;
driver = sql::mysql::MySQL_Driver::get_mysql_driver_instance();
delete con;
}

I get these errors in the Error list:



    1    IntelliSense: cannot open source file "boost/variant.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    31    1    MySQL
    2    IntelliSense: name followed by '::' must be a class or namespace name    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    41    9    MySQL
    3    IntelliSense: expected an identifier    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    41    24    MySQL
    4    IntelliSense: identifier "ConnectPropertyVal" is undefined    c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h    43    35    MySQL
    5    IntelliSense: cannot open source file "boost/shared_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_connection.h    31    1    MySQL
    6    IntelliSense: cannot open source file "boost/scoped_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_connection.h    32    1    MySQL
    7    IntelliSense: cannot open source file "boost/scoped_ptr.hpp"    c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_driver.h    30    1    MySQL
    8    IntelliSense: class "sql::mysql::MySQL_Driver" has no member "get_mysql_driver_instance"    c:\Users\Jeremy\Dropbox\C++\Projects\MySQL\MySQL\Main.cpp    9    37    MySQL
Also, you don't have time to read the docs? Seriously, with that attitude you won't get far with game programming. It takes time, lots of it.

That's also another broad statement. I have been able to code anything I've ever wanted in Java without ever touching a doc, thanks to the great community support and millions of working examples on websites such as YouTube that will teach you how to do things correctly. However with C++ there seems to be much less resources like those I found for Java, and it's much more complicated. That's why I'm trying to get help.


I get these errors in the Error list:

1 IntelliSense: cannot open source file "boost/variant.hpp" c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h 31 1 MySQL
2 IntelliSense: name followed by '::' must be a class or namespace name c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h 41 9 MySQL
3 IntelliSense: expected an identifier c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h 41 24 MySQL
4 IntelliSense: identifier "ConnectPropertyVal" is undefined c:\Program Files\MySQL\Connector C++ 1.1.3\include\cppconn\connection.h 43 35 MySQL
5 IntelliSense: cannot open source file "boost/shared_ptr.hpp" c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_connection.h 31 1 MySQL
6 IntelliSense: cannot open source file "boost/scoped_ptr.hpp" c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_connection.h 32 1 MySQL
7 IntelliSense: cannot open source file "boost/scoped_ptr.hpp" c:\Program Files\MySQL\Connector C++ 1.1.3\include\mysql_driver.h 30 1 MySQL
8 IntelliSense: class "sql::mysql::MySQL_Driver" has no member "get_mysql_driver_instance" c:\Users\Jeremy\Dropbox\C++\Projects\My

You really should start reading documentations and practice gogle fu. If you would ask google about "IntelliSense:" errors you would be know that they are not the real errors. Do you try to compile your program? If yes, are there any compile/linker errors? If yes, I guess that "cannot open source file "boost/variant.hpp" ; solution: you should give visual the path to the boost library.

If you come here to ask something, people give you advice in there own free time,
but it seems a bit that you don't want to listen to them and that you know it better.

Wow, that's a broad statement xD I never even stated anything as if I know anything better. I even admitted I can't code very well in C++, I'm a newb here. Please, before prosecuting me take a look at my past messages. I've never stated that I know more than ANYONE here. Thank you.

No offense, but i'm only trying to help you ;)


That's also another broad statement. I have been able to code anything I've ever wanted in Java without ever touching a doc, thanks to the great community support and millions of working examples on websites such as YouTube that will teach you how to do things correctly. However with C++ there seems to be much less resources like those I found for Java, and it's much more complicated. That's why I'm trying to get help.

It's not a broad statement at all. The fact is, if you think that reading the docs takes too much time, then you need to adjust your attitude. And just because you have supposedly "been able to code anything you have ever wanted" without reading any docs, it does not mean that you can keep doing that. You have been lucky (not that I consider it unlucky to have to read the docs).

Now, if you would have read the docs for the connector you would have found the line that says "As of MySQL Connector/C++ 1.1.0, the Boost C++ libraries 1.34.0 or newer must be installed.". In other words, the errors you are getting are because you are missing the boost library (or the IDE cannot find it because of incorrect include paths or something).

You can find the whole thing here: http://downloads.mysql.com/docs/connector-cpp-en.pdf

Seriously, next time check the docs (or at least do a google search). Also, remember that we all really want to help you. GD.net is an awesome community, so try not to get offended when someone more experienced gives you a gentle nudge. Good luck with your project!


I guess that "cannot open source file "boost/variant.hpp" ; solution: you should give visual the path to the boost library.

That would explain a lot. I didn't know I needed Boost. Thanks, I'll install Boost, try to compile, and let you guys know if it worked when I get back from work.


The easiest way to use MySQL from C++ is probably through the connector

I've tried the connector countless times in the past, all I get is errors. Then when I ask for help, people just point to the documentation, and tell me to read it. I don't have time to read the documentation. I read it anyways, and it was still a waste of time because I never got my problem solved.

You want to take a wild guess how I learned what I know? How about how the professionals learn to use their APIs and compile against them? They don't have a 24/7 hotline to walk them through learning it all, they have to read the documentation. If you don't have time to read documentation then you don't have time to write code.

Start small bro. Use any game engine. Go for Unity. There are lots of books and tuts available.

This topic is closed to new replies.

Advertisement