Skip to Content.
Sympa Menu

freetds - Re: [freetds] 0.83.dev.20100507 and Visual Studio 2010

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Paul Thurston <pthurston AT netegrate.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] 0.83.dev.20100507 and Visual Studio 2010
  • Date: Sat, 8 May 2010 11:05:54 -0700

Harry:

Are you using dblib and connecting to SQLServer?
My test app which connects to Sql Server 2008 has the following #include
statements:

#include <config.h>
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <sqlfront.h>
#include <sqldb.h>

I wouldn't worry too much about the compiler warnings about the unsafe calls
to sprintf, etc. Disabling these warning is quite likely just fine.

Best,

Paul


From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Harry Sfougaris
Sent: Saturday, May 08, 2010 1:52 PM
To: FreeTDS Development Group
Subject: Re: [freetds] 0.83.dev.20100507 and Visual Studio 2010




On 08 Μαϊ 2010, at 8:23 μ.μ., Paul Thurston wrote:



> Harry:

>

> Yes, I understand that you are working on a dev branch of the code.

> I thought your goal here was to get your QT application up and running on
> Windows using FreeTDS as quickly as possible.

>

Sorry, I thought it might be interesting to some people that know how to
actually fix it.



> If that is the case, might I humbly suggest you use the Stable branch of
> code to this end?

>

The following is all regarding 0.82:

----------------------------------------------------

I greatly appreciate your help.

I managed to compile it 0.82 before. With your help of course I am now
linking it correctly (I wasn't adding dblib.lib and libTDS.lib to FreeTDS).

The problem was, I could not even create a simple project using it not even
from within Visual Studio.

In my simple Visual C++ Console application, I do the following:

- I add in the include directories C:\freetds-0.82\include

- I add to linker input the 3 lib files (dblib.lib, libTDS.lib and
FreeTDS.lib)

- I add to linker directories where these are



- In my source code file I add

- #include "sybdb.h"

and in

_tmain(....) {

dbinit();

}

When trying to compile, I get an error about the missing file
"tds_sysdep_public.h"

Looking in the include directory I see there is a file named
"tds_sysdep_public.h.in", so I remove the .in extension.



Attempting to build, I get all the following linker errors:

Error 1 error LNK2001: unresolved external symbol gethostname
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(mem.obj) kklkl

Error 2 error LNK2001: unresolved external symbol inet_addr
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(config.obj) kklkl

Error 3 error LNK2001: unresolved external symbol inet_addr
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 4 error LNK2001: unresolved external symbol ntohs
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(config.obj) kklkl

Error 5 error LNK2001: unresolved external symbol ntohs
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 6 error LNK2001: unresolved external symbol gethostbyname
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(threadsafe.obj) kklkl

Error 7 error LNK2001: unresolved external symbol inet_ntoa
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(threadsafe.obj) kklkl

Error 8 error LNK2001: unresolved external symbol getservbyname
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(threadsafe.obj) kklkl

Error 9 error LNK2001: unresolved external symbol WSAStartup
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 10 error LNK2001: unresolved external symbol WSACleanup
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 11 error LNK2001: unresolved external symbol WSAGetLastError
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 12 error LNK2001: unresolved external symbol closesocket
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 13 error LNK2001: unresolved external symbol select
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 14 error LNK2001: unresolved external symbol recv
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 15 error LNK2001: unresolved external symbol send
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 16 error LNK2001: unresolved external symbol sendto
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 17 error LNK2001: unresolved external symbol ioctlsocket
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 18 error LNK2001: unresolved external symbol socket
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 19 error LNK2001: unresolved external symbol htons
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 20 error LNK2001: unresolved external symbol getsockopt
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 21 error LNK2001: unresolved external symbol connect
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 22 error LNK2001: unresolved external symbol setsockopt
C:\Users\harry.MISSIRIAN\Desktop\kklkl\kklkl\libTDS.lib(net.obj) kklkl

Error 23 error LNK1120: 20 unresolved externals
C:\Users\harry.MISSIRIAN\Desktop\kklkl\x64\Release\kklkl.exe 1 1
kklkl

24 IntelliSense: unrecognized token
c:\freetds-0.82\include\tds_sysdep_public.h 81 1

25 IntelliSense: unrecognized token
c:\freetds-0.82\include\tds_sysdep_public.h 81 14



- Adding WS2_32.lib and WSock32.lib to the project gets rid of the unresolved
symbols, but the IntelliSense error remains (I don't think that matters
anyway).

- So now, my VC++ app seems to work.



I have to now compile with the /GS- flag to remove the dependency on the all
the buffer overrun checks Visual Studio injects, to see if it will work with
Qt.



Thanks again,

Harry







> Thanks,

>

> Paul

>

> The FreeTDS Project is a user community supported Freeware Software Project

>

> From: freetds-bounces AT lists.ibiblio.org
> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Harry Sfougaris

> Sent: Saturday, May 08, 2010 12:04 PM

> To: FreeTDS Development Group

> Subject: Re: [freetds] 0.83.dev.20100507 and Visual Studio 2010

>

>

> I'm talking about the current build if freeTDS.

>

>

>

> Harry

>

>

>

> On 08 Μαϊ 2010, at 6:52 μ.μ., Paul Thurston wrote:

>

>

>

>> FYI: I'm running Windows 7 Professional 64 bit (CurrentBuildNumber = 7600)
>> and Visual Studio 2010 (version 10.0.30319.1 RTMRel)

>

>>

>

>>

>

>> From: freetds-bounces AT lists.ibiblio.org
>> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Harry Sfougaris

>

>> Sent: Saturday, May 08, 2010 4:21 AM

>

>> To: FreeTDS Development Group

>

>> Subject: [freetds] 0.83.dev.20100507 and Visual Studio 2010

>

>>

>

>>

>

>> The supplier Visual Studio solution file still doesn't compile.

>

>>

>

>> When trying to build, I get the following errors:

>

>>

>

>> Error 11 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 22 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 35 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 46 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 72 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 73 error C1189: #error : One should be defined
>> C:\freetds-0.83.dev.20100507\src\tds\net.c 243 1 TDS

>

>>

>

>> Error 84 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 95 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 109 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 120 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 131 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> Error 142 error C2011: 'pollfd' : 'struct' type redefinition
>> C:\freetds-0.83.dev.20100507\include\fakepoll.h 50 1 TDS

>

>>

>

>> 147 IntelliSense: argument of type "const void *" is incompatible
>> with parameter of type "const char *"
>> c:\freetds-0.83.dev.20100507\src\tds\net.c 233 47 TDS

>

>>

>

>> 148 IntelliSense: #error directive: One should be defined
>> c:\freetds-0.83.dev.20100507\src\tds\net.c 243 2 TDS

>

>>

>

>> 149 IntelliSense: return value type does not match the function type
>> c:\freetds-0.83.dev.20100507\src\tds\net.c 324 9 TDS

>

>>

>

>>

>

>>

>

>> I am trying to compile under Windows 7 64-bit.

>

>>

>

>> If I add HAVE_POLL to my defines (i don't know if that's correct), the
>> redefinition errors go away, but the others remain, ie.

>

>>

>

>>

>

>>

>

>> Error 73 error C1189: #error : One should be defined
>> C:\freetds-0.83.dev.20100507\src\tds\net.c 243 1 TDS

>

>>

>

>> 147 IntelliSense: argument of type "const void *" is incompatible
>> with parameter of type "const char *"
>> c:\freetds-0.83.dev.20100507\src\tds\net.c 233 47 TDS

>

>>

>

>> 148 IntelliSense: #error directive: One should be defined
>> c:\freetds-0.83.dev.20100507\src\tds\net.c 243 2 TDS

>

>>

>

>> 149 IntelliSense: return value type does not match the function type
>> c:\freetds-0.83.dev.20100507\src\tds\net.c 324 9 TDS

>

>>

>

>>

>

>>

>

>> The "one should be defined" error, I don't know how to handle. The code is
>> the following, and I don't know what should be defined for my platform.

>

>>

>

>> #if defined(USE_NODELAY) || defined(USE_MSGMORE)

>

>>

>

>> setsockopt(tds->s, SOL_TCP, TCP_NODELAY, (const void *) &len,
>> sizeof(len)); #elif defined(USE_CORK)

>

>>

>

>> if (setsockopt(tds->s, SOL_TCP, TCP_CORK, (const void *) &len,
>> sizeof(len)) < 0)

>

>>

>

>> setsockopt(tds->s, SOL_TCP, TCP_NODELAY, (const void *) &len,
>> sizeof(len)); #else #error One should be defined #endif

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>> Thanks,

>

>>

>

>>

>

>>

>

>> Harry Sfougaris

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>>

>

>> _______________________________________________

>

>>

>

>> FreeTDS mailing list

>

>>

>

>> FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org%3cmailto:FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org%3cmailto:FreeTDS AT lists.ibiblio.org%3cmailto:FreeTDS AT lists.ibiblio.org%3cmailto:FreeTDS AT lists.ibiblio.org>>>

>

>>

>

>> http://lists.ibiblio.org/mailman/listinfo/freetds

>

>> _______________________________________________

>

>> FreeTDS mailing list

>

>> FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org%3cmailto:FreeTDS AT lists.ibiblio.org>>

>

>> http://lists.ibiblio.org/mailman/listinfo/freetds

>

>

>

> Harry Sfougaris

>

>

>

>

>

>

>

>

>

> _______________________________________________

>

> FreeTDS mailing list

>

> FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org%3cmailto:FreeTDS AT lists.ibiblio.org>>

>

> http://lists.ibiblio.org/mailman/listinfo/freetds

> _______________________________________________

> FreeTDS mailing list

> FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org>

> http://lists.ibiblio.org/mailman/listinfo/freetds



Harry Sfougaris









_______________________________________________

FreeTDS mailing list

FreeTDS AT lists.ibiblio.org<mailto:FreeTDS AT lists.ibiblio.org>

http://lists.ibiblio.org/mailman/listinfo/freetds



Archive powered by MHonArc 2.6.24.

Top of Page