@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4



Comments:

<0> mhm
<1> Rethguals, It only took you... 3 hours.
<1> :)
<2> It was complicated... I had to dis***emble a useless patch panel. I also stripped a few wires out of my phone socket, and took the opportunity to vacuum the place.
<1> heh
<1> I kinda fixed that piece of **** I was working on.
<1> It's not exactly what I wanted, but it'll do for now.
<2> Aw.
<3> where to get a reference for gcc/g++ Makefile syntax?
<2> "The GNU Make Manual" + "I'm feeling Lucky"
<3> what is the ansi way to convert integer to char* string? (itoa is not ansi)
<2> sprintf/ostringstream.
<2> ostrstream if you want.
<2> snprintf if it's available (it's C99, not C++)
<4> hi all
<5> oik



<6> anyone here worked with mysql in c++?
<7> briefly
<7> why
<6> im doing this for a project on a server which i dont have root access on....i can get the root person to do stuff, but theres delays...so not much room for experimenting until something works....
<6> i got him to install mysql++ for me
<6> and things almost worked, but i keep getting the following error when compiling any provided example files or any files i found from internet
<6> simple1.cpp:(.text+0x94): undefined reference to `connect_to_db(int, char**, mysqlpp::Connection&, char const*)'
<6> simple1.cpp:(.text+0x18f): undefined reference to `utf8trans(char const*, char*, int)'
<7> might be good to read documentation of your compiler
<7> that's not a mysql-specific thing
<7> yah
<7> that has nothing to do with mysql specifically
<6> well yea
<7> connect_to_db() is an undefined function
<7> so you need to define it
<6> yea but any idea where it is
<8> you probabli need to link to some kind of library
<7> Blake7984, well, do you expect the compiler to just magically know about all of the mysql functions?
<8> (like a libmysql++.a or libmysql++.so, etc..)
<6> right now im linking to mysqlpp and mysqlclient
<7> how does the compiler know about connect_to_db?
<7> that's not a linker error, it's a compiler error
<6> no i dont expect it to know about it
<8> Blake7984: do you know where those undefined functions are declared and defined..
<7> yah, so you have to tell the compiler about the mysql functions then
<6> which is why i asked if someone knew much about mysql...i figured they might know what to tell me to specify
<7> what headers are you including?
<6> that file includes util.h, mysql++.h, iostream and iomanip
<7> mysql++.h probably includes a lot of other things unfortunately, or i'd say look inside it
<7> does your IDE have a "find definition" capability?
<7> in Visual Studio, and many other IDEs, you can right click on a term and have the IDE find its definition..
<7> the IDE might be able to find the def. even if the compiler can't
<6> not using an IDE...doing this through ssh on a linux machine
<8> which -l arguments are you p***ing?
<6> -lmysqlpp -lmysqclient
<6> aha...found it...apparently i have to build util.cpp along with whatever file i want
<7> what's util.cpp?
<6> some file thrown in the examples folder of mysql++
<6> that the documentation mentions nothing of
<7> um
<7> of course
<7> connect_to_db is not an official mysql API function
<6> i know that
<7> it's just some random function from the example you're looking at
<7> well, duh. that function is specific to your example :P
<6> well i had seen other examples which used it
<7> of course it's not gonna be defined except in the example's file
<6> which made me wonder why it was so common...thus making me thing someone in here may have seen it
<7> ok
<7> looks like it's just a wrapper around the mysql API
<7> so including the mysql API libs of course doesn't define it
<7> your util.cpp is a file common to the *examples* they provide
<6> yea i realize that now
<6> but i had seen other examples on websites which used connect_to_db so i started to think it wasnt specific to that folder of example files
<7> easy way to check for things like that in the future is to look in the MySQL API documentation -- if it's not there, and especially doesn't exist in the headers, it's not part of it
<6> well i pretty much already figured that
<7> when you noticed it was missing .. that was the trick :D
<7> yeah, i know. but now in the future you know it's a significant part, hehe
<7> you mentioned checking the docs. well now you know in the future if you check the docs and it's missing, that itself is part of your solution :D
<6> this **** was 10x easier in c than in cpp
<7> hmmm, why? that function you mention isn't part of a cl*** or anything



<7> C++ is *supposed* to be easier. if you like the my SQL C API, just use that.
<7> it should work from C++ just fine
<6> error while loading shared libraries: libmysqlpp.so: cannot open shared object file: No such file or directory
<6> any suggestions on that one?
<9> link time or run time
<6> run
<6> damn i hope i dont need root access to fix whatever the problem is there
<7> copy the .so to the folder where the program is and try that
<7> it sounds like it's looking in the wrong place for the .so
<6> tried it
<6> didnt work
<7> hmm...
<7> get out the bible and pray? :P
<6> damnit
<6> im gonna have to get root to do some more stuff
<6> i just wish i knew what all it is so i wouldnt have to keep contacting him
<10> guys, can someone tell me under what circumstances can the STL vector's push_back() function call crash?
<10> i'm trying to debug my code and I have no idea why my program is crashing on the push_back() call
<10> this is my code
<10> snNode *_temp_node = NULL; _temp_node = new snNode(node_type,node_id);
<10> if(_temp_node==NULL) cout << "WTF" << endl;
<10> this->nodes.push_back(_temp_node);
<10> it doesn't output WTF, and it crashes on the last line
<10> any ideas?
<7> what is nodes?
<10> nodes is a stl vector of snNode *
<10> vector<snNode *> nodes;
<7> what does the crash message say?
<10> memroy access violation, the debugger takes me to this code:
<10> size_type size() const
<10> {// return length of sequence
<10> return (_Myfirst == 0 ? 0 : _Mylast - _Myfirst);
<10> }
<10> this is in the stl vector
<7> what are _Mylast and _Myfirst
<7> ?
<7> set a breakpoint and run the program until it hits that line
<10> thats part of stl vector man :P
<10> thats not my code
<7> so?
<7> that doesn't matter... find out what they are
<10> are you asking what is the first and last element in my vector?
<7> if you find out what they are, you can find out where they get set that value
<7> no... I'm asking what _Mylast and _Myfirst are
<7> the fact that it's in STL code doesn't prevent you from debugging it
<10> those are just part of the STL vector cl***, they are the first and last element in the vector
<7> are you listening to me?
<7> those are the only things on the line that can crash the code
<7> they have to be out of scope
<11> they never do
<12> Hey, is there any function like atoi() but that will turn a floating point number (stored in a string) into a double?
<7> stop the debugger there and look at the values
<7> jauncie: use std::stringstream
<10> it says error: expression cannot be evaluated for myfirst and mylast
<7> yah, that tells you something
<7> it tells you the vector you're working with is totally fubar
<7> my guess is you created the vector on the stack and kept a copy of it
<10> yea, i already guessed that.. but what is the problem, thats what i'm asking. because th thing crashes on the first value pushback that i do
<7> maybe :P
<7> you aren't showing enough of the code
<7> what is "this" and how does it obtain a vector?
<10> man
<10> this is a pointer to the current cl***
<7> yah, paste the cl*** to pastehere.com
<10> and i'm not creating the thing on the stack
<10> its in the heap
<10> plus its not huge either, its tiny
<12> Xiphoris: What about something that will turn an integer (stored in a string) into an int, but that will give me some way to check if an error occurred due to a non-numerical character in the string?
<10> jauncie, don't be a *****. just parse the damn string
<7> jauncie: stringstream does that
<7> BitShifter: ... don't be an idiot.. use code that's written for you :P
<10> what part of the code do you want to see
<10> i'm not, i always use stringstreams
<12> Xiphoris: how? the stream's failbit?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

chat en gaylima
free videopornchat
#c++
#allnitecafe gurli
Punga11
#india
#allnitecafe
#chat-world
shi3a chat
honda crepo



Home  |  disclaimer  |  contact  |  submit quotes