Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

MySQL and C++

Name: Anonymous 2010-05-10 20:13

I've been trying to follow the tutorial on the MySQL Connector C++ documentation. However, I constantly get a linker error:

1>driver.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class sql::mysql::MySQL_Driver * __cdecl sql::mysql::get_mysql_driver_instance(void)" (__imp_?get_mysql_driver_instance@mysql@sql@@YAPAVMySQL_Driver@12@XZ) referenced in function _main
1>TestProject2.exe : fatal error LNK1120: 1 unresolved externals

I'm fairly new to C++ and basically everything I find says "Figure it out.", which makes it about as fun as smashing my face into a brick wall. Thanks guys.

Name: Anonymous 2010-05-10 20:21

Well, that's easy! You should be able to figure it out!

Does that annoyyou?

Name: Anonymous 2010-05-10 20:22

It means just what it means.
unresolved external symbol
Are you passing that mysql lib to the linker? Is the version the one that it's epxecting?

Name: Anonymous 2010-05-10 20:43

I think you should try to resolve externals.

Name: Anonymous 2010-05-10 20:49

If you can't even read error messages you shouldn't be using Sepples, because you'll be getting a lot of them.

Name: Anonymous 2010-05-10 21:33

>>1
You have not one, not two, but THREE problems:
1. You are using MySQL
2. You are using C++
3. You are using Visual C++, which does not support C99

Name: Anonymous 2010-05-10 21:45

"Unresolved external" is debugger speak for "user doesn't know what he's doing."

Name: Anonymous 2010-05-10 22:11

>>7
Or someone who knows what he's doing, but forgot to set up the libraries used by his linker.

Name: Anonymous 2010-05-11 2:02

>>8
Yeah this. You're not linking against the connector lib.

>>6
As much as I hate VS's lack of C99 support, this isn't the problem here. The connector he's using is sepples.

Name: air max shoes 2010-07-23 11:01

http://www.cheapairmaxs.com air max
http://www.cheapairmaxs.com air max shoes
http://www.cheapairmaxs.com/nike-air-max-2012-c-111.html nike air max 2012
http://www.cheapairmaxs.com/mens-air-max-2010-c-93.html mens nike air max 2010
http://www.cheapairmaxs.com/womens-air-max-2010-c-96.html womens nike air max 2010
http://www.cheapairmaxs.com/mens-air-max-2009-c-95.html mens nike air max 2009
http://www.cheapairmaxs.com/womens-air-max-2009-c-98.html womens nike air max 2009
http://www.cheapairmaxs.com/nike-air-max-2003-c-101.html nike air max 2003
http://www.cheapairmaxs.com/nike-air-max-97-c-94.html nike air max 97
http://www.cheapairmaxs.com/mens-air-max-95-c-102.html mens nike air max 95
http://www.cheapairmaxs.com/womens-air-max-95-c-103.html womens nike air max 95
http://www.cheapairmaxs.com/nike-air-max-93-c-106.html nike air max 93
http://www.cheapairmaxs.com/mens-air-max-91-c-104.html mens nike air max 91
http://www.cheapairmaxs.com/womens-air-max-91-c-105.html womens nike air max 91
http://www.cheapairmaxs.com/nike-air-max-89-c-121.html nike air max 89
http://www.cheapairmaxs.com/nike-air-max-88-c-112.html nike air max 88
http://www.cheapairmaxs.com/mens-air-max-87-c-108.html mens nike air max 87
http://www.cheapairmaxs.com/womens-air-max-87-c-109.html womens nike air max 87
http://www.cheapairmaxs.com/nike-air-max-180-c-123.html nike air max 180
http://www.cheapairmaxs.com/nike-air-max-360-c-124.html nike air max 360
http://www.cheapairmaxs.com/mens-air-max-ltd-c-122.html mens air max ltd
http://www.cheapairmaxs.com/womens-air-max-ltd-c-116.html womens air max ltd
http://www.cheapairmaxs.com/nike-air-max-bw-c-117.html nike air max bw
http://www.cheapairmaxs.com/air-max-premium-c-118.html air max premium
http://www.cheapairmaxs.com/air-max-skyline-c-114.html air max skyline
http://www.cheapairmaxs.com/air-max-zenyth-c-125.html air max zenyth
http://www.cheapairmaxs.com/nike-air-max-tn-c-115.html nike air max tn
http://www.cheapairmaxs.com/kids-air-max-90-c-119.html kids air max 90
http://www.cheapairmaxs.com/kids-air-max-bw-c-120.html kids air max bw

Name: Anonymous 2010-07-23 11:59

I've always disliked the phrase "unresolved externals."  Can't they name it something else?

Name: Anonymous 2010-07-23 12:02

>>11
It makes perfect sense. You named a symbol, and that symbol is expected to be external. The compiler put in the references, but when it was time for the linker to build the executable, it couldn't find from where to import that symbol, thus some externals are missing, either due to the library being missing, or the library being of a wrong version, and thus the export is missing and couldn't be resolved, thus "unresolved externals".

Name: Anonymous 2010-07-23 13:15

>>11
"Man, we ain't found shit."

Name: Anonymous 2010-07-23 15:47

>>13
I approve of this compiler error.

Name: Anonymous 2010-07-24 10:30

>>14
gcc -nigger

Name: Anonymous 2010-07-24 11:02

>>15
* gcc -African American

Name: Anonymous 2010-07-24 12:12

>>16
* gcc --African-American

don't you know anything about long arguments?

Name: Anonymous 2010-07-24 12:14

>>17
ImageMagick

Name: Anonymous 2010-07-24 12:16

>>17
/prog/ has them all the time over the most pointless of shit.

Name: Anonymous 2010-07-24 15:21

>>19
./fuckme --I-feel-one-coming-on-now

Name: Anonymous 2010-07-25 20:07

Bump to get the backwards shit off the front page

Name: Anonymous 2010-07-25 20:11

>>21
This thread is so depressing though:

"Help, I am getting a linker error?"

This problem almost always has the same answer. For once I'd like to see an interesting linker problem.

Name: Anonymous 2010-07-26 4:25

>>22
Here's my favorite linker problem:

ld: scattered reloc r_address too large for inferred architecture ppc

I think it happens because the program being linked is just too damn big.  It happens when you compile GHC 6.12 or newer on OS X / PowerPC.  The toolchain won't get fixed because Apple hasn't shipped a PowerPC in half a decade.

Name: Anonymous 2010-07-26 4:37

>>23

Changed 13 months ago by thorkilnaur

The problem appeared between the PPC Mac OS X builds  http://darcs.haskell.org/buildbot/all/builders/tnaur%20PPC%20OSX%20head%202/builds/223 and  http://darcs.haskell.org/buildbot/all/builders/tnaur%20PPC%20OSX%20head%202/builds/224. Searching the patches applied between those two builds, I have found that the problem appears precisely when the patch

Fri Apr  3 10:46:34 CEST 2009  simonpj@microsoft.com
  * Adjust inlining heursitics

is applied. I have also tried to unpull this patch from the HEAD repository of the tnaur PPC OSX head 2 builder and then the build succeeds. (The tnaur PPC OSX head 2 builder has suffered from other errors lately, the latest build that reports the error reported in the present ticket is  http://darcs.haskell.org/buildbot/all/builders/tnaur%20PPC%20OSX%20head%202/builds/252/steps/compile/logs/stdio.)

Best regards Thorkil

Name: Anonymous 2010-07-26 8:42

>>22
How about the one where runtime linker paths are affected by compile-time linker options?

Don't change these.
Name: Email:
Entire Thread Thread List