I have tried in many ways how to link a project that I made with Dev-C++. With Visual C++ I have no problems, but...
It says something like mysql_init@4.
I don't know what is it...
Help me
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
mysql1.o(.text+0x9b):mysql1.c: undefined reference to `mysql_init@4'
mysql1.o(.text+0xe4):mysql1.c: undefined reference to `mysql_real_connect@32'
mysql1.o(.text+0xfe):mysql1.c: undefined reference to `mysql_error@4'
mysql1.o(.text+0x12b):mysql1.c: undefined reference to `mysql_query@8'
mysql1.o(.text+0x148):mysql1.c: undefined reference to `mysql_error@4'
mysql1.o(.text+0x16d):mysql1.c: undefined reference to `mysql_store_result@4'
mysql1.o(.text+0x17e):mysql1.c: undefined reference to `mysql_num_rows@4'
mysql1.o(.text+0x1a0):mysql1.c: undefined reference to `mysql_fetch_row@4'
mysql1.o(.text+0x21b):mysql1.c: undefined reference to `mysql_free_result@4'
mysql1.o(.text+0x229):mysql1.c: undefined reference to `mysql_close@4'
make.exe: *** [mysql1.exe] Error 1
Execution terminated
Read your link so included the mysql lib folder to the Lib directories through compiler options.
Was hoping for a bit more direction
Thanks AL
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"Read your link so included the mysql lib folder to the Lib directories through compiler options"
That is not the right way to do it if your are using a project, and you are. The project options for linking over-write the compiler options, which is why there is no link command to be seen in your log, i.e no:
-lmysql
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wrote a section in the thread titled "The Forum FAQ - Please Read First" on the compile log, headers and linking libraries which I think gives you what you are looking for...
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Execution terminated
Compilation successful
..........................
when I run the app I get a error "Unable to Locate Component"
fialed to start because libmySQL.dll was not found.
I've moved the file around to various dirs but no joy!!
When I placed the Dll in the project dir the prog runs but does nothing not even a printf statement (towards the start of the code).
Any suggestions?
From the compile log you can see I have liked the Lib both methods suggested. I've tried each method seperatly and then at the end both together.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Generally, you dll's should be in either your Dev bin directory or your windows system32 directory. Think of them as being where an executable or a binary would be.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried in many ways how to link a project that I made with Dev-C++. With Visual C++ I have no problems, but...
It says something like mysql_init@4.
I don't know what is it...
Help me
-lmysql =)
Kip
.c app
dev-cpp version:
Dev-C++ 5.0 beta 9 (4.9.9.0) with Mingw/GCC
downloaded and installed MySQL Dev-PAK
hedder code:
#include <time.h>
#include <stdio.h>
#include <winsock.h>
#include <MySQL/mysql.h>
Compile Log:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\projects\mysql1\Makefile.win"
Executing make clean
rm -f mysql1.o mysql1.exe
gcc.exe -c mysql1.c -o mysql1.o -I"C:/Dev-Cpp/include" -ansi
gcc.exe mysql1.o -o "mysql1.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/lib/MySQL" -mwindows
mysql1.o(.text+0x9b):mysql1.c: undefined reference to `mysql_init@4'
mysql1.o(.text+0xe4):mysql1.c: undefined reference to `mysql_real_connect@32'
mysql1.o(.text+0xfe):mysql1.c: undefined reference to `mysql_error@4'
mysql1.o(.text+0x12b):mysql1.c: undefined reference to `mysql_query@8'
mysql1.o(.text+0x148):mysql1.c: undefined reference to `mysql_error@4'
mysql1.o(.text+0x16d):mysql1.c: undefined reference to `mysql_store_result@4'
mysql1.o(.text+0x17e):mysql1.c: undefined reference to `mysql_num_rows@4'
mysql1.o(.text+0x1a0):mysql1.c: undefined reference to `mysql_fetch_row@4'
mysql1.o(.text+0x21b):mysql1.c: undefined reference to `mysql_free_result@4'
mysql1.o(.text+0x229):mysql1.c: undefined reference to `mysql_close@4'
make.exe: *** [mysql1.exe] Error 1
Execution terminated
Read your link so included the mysql lib folder to the Lib directories through compiler options.
Was hoping for a bit more direction
Thanks AL
"Read your link so included the mysql lib folder to the Lib directories through compiler options"
That is not the right way to do it if your are using a project, and you are. The project options for linking over-write the compiler options, which is why there is no link command to be seen in your log, i.e no:
-lmysql
Wayne
At the rsik of stating what may be obvious to you, note that:
-L"C:/Dev-Cpp/lib/MySQL"
Is not a link command, it simply adds a directory to the library search path...
Wayne
Yea ok remember the difference now ... thank you.
Is it (and how is it) possible to link the library to the project in Dev-Cpp so that it will be compiled& built with one click
I wrote a section in the thread titled "The Forum FAQ - Please Read First" on the compile log, headers and linking libraries which I think gives you what you are looking for...
Wayne
Hi again.
Ok, I'v now linked the -lmysql
compiles fine (or so it seems)
compile Log:
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\projects\mysql1\Makefile.win"
Executing make clean
rm -f mysql1.o mysql1.exe
gcc.exe -c mysql1.c -o mysql1.o -I"C:/Dev-Cpp/include" -ansi
gcc.exe mysql1.o -o "mysql1.exe" -L"C:/Dev-Cpp/lib" -L"C:/mysql/lib" -mwindows -lmysql ../../lib/libmySQL.a
Execution terminated
Compilation successful
..........................
when I run the app I get a error "Unable to Locate Component"
fialed to start because libmySQL.dll was not found.
I've moved the file around to various dirs but no joy!!
When I placed the Dll in the project dir the prog runs but does nothing not even a printf statement (towards the start of the code).
Any suggestions?
From the compile log you can see I have liked the Lib both methods suggested. I've tried each method seperatly and then at the end both together.
Generally, you dll's should be in either your Dev bin directory or your windows system32 directory. Think of them as being where an executable or a binary would be.
Wayne