Bug #45318 Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"
Submitted: 4 Jun 2009 0:50 Modified: 6 Jul 2009 11:02
Reporter: Chung Il Lee Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version: OS:Windows
Assigned to: CPU Architecture:Any

[4 Jun 2009 0:50] Chung Il Lee
Description:
Hi

There are a lot of warnings and errors at link stages as following program.
This is very simple program, but I've tried many times on 3 computers.
I used MinGW5.1.4
It is working good under Linux Environment or VS on Windows.
Do I missing some options at complie?
Thanks in advance

===============
#include <winsock2.h>
#include <windows.h>
#include "mysql.h"
#include <stdio.h>
#include <stdlib.h>

int main(void) {

	  MYSQL *conn;
	  MYSQL_RES *res;
	  MYSQL_ROW row;

	   char *server = "localhost";
	   char *user = "root";
	   char *password = "corebell";
	   char *database = "menagerie";
	   conn = mysql_init(NULL);
	printf("!!!Hello World!!! %s", server); 

	return EXIT_SUCCESS;
}

How to repeat:
gcc -LC:\mysql-connector-c-noinstall-6.0.1-win32\lib -orfidcsample.exe src\rfidcsample.o -lmysqlclient -llibmysql
and 
gcc -LC:\mysql-connector-c-noinstall-6.0.1-win32\lib -orfidcsample.exe src\rfidcsample.o -luuid -lmysqlclient -llibmysql
=========================
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
`/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
.....
Warning: .drectve `/DEFAULTLIB:"libcpmt" /DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
....
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
C:\mysql-connector-c-noinstall-6.0.1-win32\lib/mysqlclient.lib(./mysqlclient.dir/RelWithDebInfo/integer.obj):(.data[??_R0?AVMultiplicativeGroupT@AbstractRing@TaoCrypt@@@8]+0x0): undefined reference to `??_7type_info@@6B@'
C:\mysql-connector-c-noinstall-6.0.1-win32\lib/mysqlclient.lib(./mysqlclient.dir/RelWithDebInfo/integer.obj):(.data[??_R0?AVAbstractGroup@TaoCrypt@@@8]+0x0): undefined reference to `??_7type_info@@6B@'
...
[4 Jun 2009 1:09] Vladislav Vaintroub
It looks like you're trying to link both with static and dynamic libraries.
Any specific reason for that?

Also , using static libraries with a different compiler  that the compiler that was used to build the lib is almost always guaranteed to fail. Even different version of the same compiler is problematic.
[4 Jun 2009 1:16] Vladislav Vaintroub
To clarify the last comment :
/DEFAULTLIB is a directive that is Visual Studio specific. It is added by the compiler if source contains
#pragma comment(linker,"/DEFAULTLIB:something")
 
It is meant to be processed by the microsoft linker when creating final executable - microsoft linker understands the directive. MinGW does not understand it
[4 Jul 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[6 Jul 2009 11:02] Vladislav Vaintroub
On Windows, we only support Visual Studio compiler at the moment. Users that need static linking need to use Visual Studio compiler .MinGW users need to link with dynamic library.