Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Error when compiling native MySql with MSC9
Error when compiling native MySql with MSC9 [message #34170] Wed, 26 October 2011 19:10 Go to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi all friends,

I got a recurrent issue with MysSql library. When compiling native MySql, the following error messages appear:

----- CtrlLib ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (1 / 11)
----- Sql ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (2 / 11)
----- MySql ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (3 / 11)
----- CtrlCore ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (4 / 11)
----- Draw ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (5 / 11)
----- plugin/bmp ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (6 / 11)
----- RichText ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (7 / 11)
----- Core ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (8 / 11)
MySql.cpp
----- plugin/z ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (9 / 11)
----- plugin/png ( GUI MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (10 / 11)
----- DirectDB ( GUI MAIN MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (11 / 11)
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : error C2146: syntax error : missing ';' before identifier 'find_typeset'
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support d
efault-int
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support d
efault-int
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(39) : error C2146: syntax error : missing ';' before identifier 'find_set_from_flags'

C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(39) : error C4430: missing type specifier - int assumed. Note: C++ does not support d
efault-int
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(40) : error C2061: syntax error : identifier 'my_ulonglong'
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(42) : error C4430: missing type specifier - int assumed. Note: C++ does not support d
efault-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(123) : error C2378: 'my_ulonglong' : redefinition; symbol cannot be overloaded
with a typedef
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(146) : error C2146: syntax error : missing ';' before identifier 'rows'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(146) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(146) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(260) : error C2146: syntax error : missing ';' before identifier 'affected_rows
'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(260) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(260) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(261) : error C2146: syntax error : missing ';' before identifier 'insert_id'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(261) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(261) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(262) : error C2146: syntax error : missing ';' before identifier 'extra_info'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(262) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(262) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(310) : error C2146: syntax error : missing ';' before identifier 'row_count'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(310) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(310) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(400) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(400) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(400) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(400) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(410) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(410) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(410) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(410) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(411) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(411) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(411) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(411) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(531) : error C2061: syntax error : identifier 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(692) : error C2146: syntax error : missing ';' before identifier 'affected_rows
'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(692) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(692) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(693) : error C2146: syntax error : missing ';' before identifier 'insert_id'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(693) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(693) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(815) : error C2061: syntax error : identifier 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(816) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(816) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(816) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(816) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(817) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(817) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(817) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(817) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(818) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(818) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(818) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(818) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
MySql: 1 file(s) built in (0:01.18), 1182 msecs / file, duration = 2308 msecs, parallelization 97%
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : error C2146: syntax error : missing ';' before identifier 'find_typeset'
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support d
efault-int
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support d
efault-int
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(39) : error C2146: syntax error : missing ';' before identifier 'find_set_from_flags'

C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(39) : error C4430: missing type specifier - int assumed. Note: C++ does not support d
efault-int
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(40) : error C2061: syntax error : identifier 'my_ulonglong'
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(42) : error C4430: missing type specifier - int assumed. Note: C++ does not support d
efault-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(123) : error C2378: 'my_ulonglong' : redefinition; symbol cannot be overloaded
with a typedef
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(146) : error C2146: syntax error : missing ';' before identifier 'rows'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(146) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(146) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(260) : error C2146: syntax error : missing ';' before identifier 'affected_rows
'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(260) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(260) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(261) : error C2146: syntax error : missing ';' before identifier 'insert_id'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(261) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(261) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(262) : error C2146: syntax error : missing ';' before identifier 'extra_info'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(262) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(262) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(310) : error C2146: syntax error : missing ';' before identifier 'row_count'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(310) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(310) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(400) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(400) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(400) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(400) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(410) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(410) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(410) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(410) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(411) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(411) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(411) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(411) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(531) : error C2061: syntax error : identifier 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(692) : error C2146: syntax error : missing ';' before identifier 'affected_rows
'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(692) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(692) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(693) : error C2146: syntax error : missing ';' before identifier 'insert_id'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(693) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(693) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(815) : error C2061: syntax error : identifier 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(816) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(816) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(816) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(816) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(817) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(817) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(817) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(817) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(818) : error C2143: syntax error : missing ';' before '__stdcall'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(818) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(818) : error C2086: 'int my_ulonglong' : redefinition
C:\Program Files\MySQL\MySQL Server 5.5\include\typelib.h(29) : see declaration of 'my_ulonglong'
C:\Program Files\Microsoft Visual Studio 9.0\Vc\Include\MySql.h(818) : error C4430: missing type specifier - int assumed. Note: C++ does not su
pport default-int
D:\Logiciels\Projets Ultimate\DirectDB/DirectDB.sch(1) : fatal error C1903: unable to recover from previous error(s); stopping compilation
DirectDBmain.cpp
DirectDB: 1 file(s) built in (0:02.70), 2703 msecs / file, duration = 3838 msecs, parallelization 58%

There were errors. (0:04.04)

I go through this problem by using ODBC connection but it could not be a suitable solution for large databases and a lot of users trying to connect to the database.

Any idea ?

Thanks for help

Biobytes
Re: Error when compiling native MySql with MSC9 [message #34276 is a reply to message #34170] Mon, 07 November 2011 18:44 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi alls,

To go on with this issue when compiling directly with MysSql headers and libs not through ODBC driver, I noticed that setting the project option to Multithreading (MT), I got now only one link error Rolling Eyes :

Linking...
LINK : fatal error LNK1181: cannot open input file 'opt\mysqlclient.lib'

There were errors. (0:01.31)


I took the idea from MySql website where it is said that a multi threaded mysql client library is required.

So anybody has an idea to solve this linkage error ?

Help will be appreciated

Thanks in advance

Biobytes
Re: Error when compiling native MySql with MSC9 [message #34295 is a reply to message #34276] Tue, 08 November 2011 20:08 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
BioBytes wrote on Mon, 07 November 2011 12:44

Hi alls,

To go on with this issue when compiling directly with MysSql headers and libs not through ODBC driver, I noticed that setting the project option to Multithreading (MT), I got now only one link error Rolling Eyes :

Linking...
LINK : fatal error LNK1181: cannot open input file 'opt\mysqlclient.lib'

There were errors. (0:01.31)


I took the idea from MySql website where it is said that a multi threaded mysql client library is required.

So anybody has an idea to solve this linkage error ?

Help will be appreciated

Thanks in advance

Biobytes


Should be pretty easy, you need to add library path to build method which, combined with 'opt/mysqlclient.lib' would lead to actual .lib file...
Re: Error when compiling native MySql with MSC9 [message #34299 is a reply to message #34295] Wed, 09 November 2011 19:33 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Thanks Mirek,

I added the path to opt/mysqlclient.lib directory in Build methods but I still get a linkage error:

Linking...
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
D:\Logiciels\Projets Ultimate\OutPrjs\Mes Projets\MSC9.Debug.Debug_Full.Mt\DirectDB.exe : fatal error LNK1120: 1 unresolved externals

There were errors. (0:13.43)

I guess there is some issue with external functions in mysqlclient library. Do you think it is possible to link without mysqlclient.lib ?

Looking forward for reading you

Biobytes
Re: Error when compiling native MySql with MSC9 [message #34300 is a reply to message #34299] Wed, 09 November 2011 19:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
BioBytes wrote on Wed, 09 November 2011 13:33

Thanks Mirek,

I added the path to opt/mysqlclient.lib directory in Build methods but I still get a linkage error:

Linking...
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
D:\Logiciels\Projets Ultimate\OutPrjs\Mes Projets\MSC9.Debug.Debug_Full.Mt\DirectDB.exe : fatal error LNK1120: 1 unresolved externals

There were errors. (0:13.43)

I guess there is some issue with external functions in mysqlclient library. Do you think it is possible to link without mysqlclient.lib ?

Looking forward for reading you

Biobytes


This actually looks like you do not have MAIN (either GUI_APP_MAIN or CONSOLE_APP_MAIN).

Mirek
Re: Error when compiling native MySql with MSC9 [message #34301 is a reply to message #34295] Wed, 09 November 2011 21:14 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Thanks Mirek,

I had path to opt/Mysqlclient.lib directory in build methods but still a linkage error:

Linking...
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
D:\Logiciels\Projets Ultimate\OutPrjs\Mes Projets\MSC9.Debug.Debug_Full.Mt\DirectDB.exe : fatal error LNK1120: 1 unresolved externals

There were errors. (0:08.33)


It seems there is a problem with external calls in mysqlclient.lib

Do you think it is possible to link without mysqlclient library as suggested in some forums in which users try to solve LNK2019 error with MS compilers? Confused

Waiting reading you

Biobytes


Re: Error when compiling native MySql with MSC9 [message #34302 is a reply to message #34301] Wed, 09 November 2011 21:42 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Mirek,

Sorry and confused Embarassed for the following points:

First: double post (I did not see you reply so fast).

Second: I forgot to indicate in the package configuration that the project needs GUI MT and not MT alone.

Now no more linkage error but the application crashes. Please find herafter the header, cpp and schema files;

Header:

#ifndef _DirectDB_DirectDB_h
#define _DirectDB_DirectDB_h

#include <CtrlLib/CtrlLib.h>
#include <MySql/MySql.h>

using namespace Upp;

#define LAYOUTFILE <DirectDB/DirectDB.lay>
#include <CtrlCore/lay.h>

#define IMAGEFILE <DirectDB/DirectDB.iml>
#include <Draw/iml_header.h>

#define SCHEMADIALECT <MySql/MySqlSchema.h>
#define MODEL <DirectDB/DirectDB.sch>
#include <Sql/sch_header.h>

SqlId TBLPROCS("PROCESSUS"),NAME("NAMEPROC"),CODE("CODEPROC");

class DirectDBWin : public WithDirectDBWinLayout<TopWindow> {
public:
typedef DirectDBWin CLASSNAME;
MySqlSession session;

DirectDBWin();
};

#endif


Scheme file:

TABLE (OWNERS)
INT(IDOWNER)PRIMARY_KEY AUTO_INCREMENT
INT(IDPROCOWNER)
STRING_(OWNERNAME,200)
STRING_(OWNERFIRSTNAME,200)
STRING_(OWNERLOGON,20)
STRING_(OWNERSTATUS,1)
INT(IDPROC1)
INT(IDPROC2)
END_TABLE

TABLE (PROCESSUS)
INT(IDPROC)PRIMARY_KEY AUTO_INCREMENT
STRING_(CODEPROC,30)
STRING_(NAMEPROC,100)
END_TABLE

TABLE (SKILLS)
INT(IDSKILL)PRIMARY_KEY AUTO_INCREMENT
INT(IDPROCSKILL)
STRING(SKILL,400)
INT(IDRANGE)
END_TABLE

TABLE (SKILLSLEVEL)
INT(IDLEVEL)PRIMARY_KEY AUTO_INCREMENT
INT(IDSKILLLEVEL)
INT(SKILLLEVEL)
STRING_(OPENAME,200)
STRING_(OPEFIRSTNAME,200)
STRING_(OPESHORTID,20)
END_TABLE


cpp file:

#include "DirectDB.h"

#define IMAGECLASS DirectDBImg
#define IMAGEFILE <DirectDB/DirectDB.iml>
#include <Draw/iml.h>

#define SCHEMADIALECT <MySql/MySqlSchema.h>
#include <Sql/sch_source.h>

DirectDBWin::DirectDBWin()
{
CtrlLayout(*this, "Window title");
if(session.Connect("patrice","patrice","skillsdb","127.0.0.1 ",3306,NULL))
{
PromptOK("Connexion réussie");

SQL *Select(CODE,NAME).From(TBLPROCS);

while(SQL.Fetch())PromptOK(AsString(SQL[0])+" : "+AsString(SQL[1]));
}

else PanicMessageBox("Erreur","Pas de connexion possible");
}

GUI_APP_MAIN
{
SetLanguage(GetSystemLNG());
SetLNGCharset(GetSystemLNG(),CHARSET_UTF8);

DirectDBWin().Run();
}


Do you have any comments ? I have no idea of what is not working now.

Thank you again for your help

Biobytes

[Updated on: Wed, 09 November 2011 22:10]

Report message to a moderator

Re: Error when compiling native MySql with MSC9 [message #34307 is a reply to message #34302] Thu, 10 November 2011 22:02 Go to previous message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi Mirek,

With your help and suggestions, I succeeded to compile my demo project. I forgot to add "SQL = session" just after getting the connection.

#include "DirectDB.h"

#define IMAGECLASS DirectDBImg
#define IMAGEFILE <DirectDB/DirectDB.iml>
#include <Draw/iml.h>

#define SCHEMADIALECT <MySql/MySqlSchema.h>
#include <Sql/sch_source.h>

DirectDBWin::DirectDBWin()
{
CtrlLayout(*this, "Window title");
if(session.Connect("alexandre","deming","skillsdb","127.0.0.1 ",3306,NULL))
{
PromptOK("Connexion réussie");
SQL = session; (new line)

try
{
SQL &Select(CODE,NAME).From(TBLPROCS);

while(SQL.Fetch())PromptOK(AsString(SQL[0])+" : "+AsString(SQL[1]));
}
catch(SqlExc &ex)
{
PanicMessageBox(t_("Erreur MySql"),t_("L'erreur suivante s'est produite : ")+ex.ToString());
Close();
}
}

else PanicMessageBox("Erreur","Pas de connexion possible");
}

GUI_APP_MAIN
{
SetLanguage(GetSystemLNG());
SetLNGCharset(GetSystemLNG(),CHARSET_UTF8);

DirectDBWin().Run();
}


Really U++ is an amazing tool for C++ development.

I got some difficulties to link with MySql library so I went through ODBC to by-pass use of native MySql. Now all is working perfectly. So I would like to post some help for newbie probably facing the same problems.

Please consider this topic closed.

Thanks again for your help

Regards
Biobytes
Previous Topic: SqlMassinsert
Next Topic: Sqlite Delete not working [SOLVED]
Goto Forum:
  


Current Time: Fri Jun 21 23:26:49 CEST 2024

Total time taken to generate the page: 0.01944 seconds