Hi All,
This is a response to the linker error messages or the undefined reference error, etc.
Do a search in the dev-c++ folders for the text of the undefined reference. I use grep, so the command would be:
grep -i -r 'mysql_server_init@12' * (or whatever the undefined reference is.) Usually the problem is a library that hasn't been included or that the compiler can't find due to a path problem.
If grep returns nothing, then a file containing that text doesn't exist in the dev-c++ path. If the file is on another path, the properly point the compiler via the dev-c++ project properties windows. Either add it to the compiler parameters sub-window, or place its path in the library path sub-window.
If grep returns with a file name, add that library, however sometimes you'll get more than one library name. Use the most likely library, then. If the actual file name is libsomething.a, add it in the parameters window as -Isomething, not as -Ilibsomething.a. That's a common error that's part of the dev-c++ learning curve. Read the gcc manual to insure that I haven't buggered up with the last statement!
main.o(.text+0x127):main.cpp: undefined reference to `Direct3DCreate9@4' is saying that it can't find that name in the libraries, as that's the format of library reference names, same with the mysql error.
BTW: There's other ways to reset the class browser. I use the show all characters switch in editor options. Pain in the butt. IMHO, I believe that the class browser should rescan automatically whenever a variable is added, or a button should be provided to rescan it. If anybody knows of a simpler way to rescan the class browser, please let us know!
Hope the above helps!
Eesh Modi <ees...@te...> wrote:
I am new at programming in general. But i have written a small windows program that i have been trying to link with MySQL. I have included the mysql.h and mysql_embed.h header files, and have added -lmysqld embedded library for linking. I have also added the path to these files. When I compile my program, I get error messages for all of the MySQL functions in my program.
[Linker error] undefined reference to 'mysql_server_init@12'
[Linker error] undefined reference to 'mysql_init@4'
[Linker error] undefined reference to 'mysql_real_connect@32'
and so on...
What am i doing wrong. If someone could help, I would appreciate it.
Thanks
Eesh
Alfred P. Reaud
|