Visual C++ Express Linker Errors

I seem to be getting my clock cleaned by VC++. The juce test projects work fine, then once I start adding external libs it goes off the tracks.

I have:
juce compiled as multi-threaded static lib
another library (C++ sockets) as a multi-threaded static lib
my juce based app linked against same

All my paths seem to be OK, and after a lot of header order switching I can make the whole thing compile. But it won’t link.

First I had 4 link errors, unable to resolve xran and xlen (the lib uses std::string and STL). I googled the heck out of that, checked and rechecked what libs I was using, then started trial and error.

I changed (VCInstallDir)lib in my paths to (VSInstallDir)lib - I had thought it was just a difference between Jules’ install and mine, but now I suspect not.

Now libcpmt.lib isn’t found - I add C:\PROGRAM FILES\Microsoft Visual Studio 8\VC\lib, where this lib is, and get back to the string errors (see below)

Anyone have clues please? Or can anyone tell me where to explore further? Am I Missing files?

Bruce

[code]Build Log Rebuild started: Project: EncoreVC, Configuration: Release|Win32

Command Lines Creating temporary file “c:\Documents and Settings\Bruce Wheaton\My Documents\Visual Studio 2005\Projects\EncoreVC_j41\Release\RSP0000721396112.rsp” with contents

[

/O2 /Ob1 /D “WIN32” /D “NDEBUG” /D “_WINDOWS” /D “SOCKETS_NAMESPACE=sockets” /D “SOCKETS_NAMESPACE_STR=’“sockets”’” /D “_THREADSAFE_SOCKETS” /D “_VC80_UPGRADE=0x0600” /D “_MBCS” /GF /FD /EHsc /MT /Gy /Fp".\Release/EncoreVC.pch" /Fo".\Release/" /Fd".\Release/" /W3 /c /TP “.\src\Comms\DeviceDirectSocket.cpp”

<snip, source files compiling successfully>
]

Creating command line “cl.exe @“c:\Documents and Settings\Bruce Wheaton\My Documents\Visual Studio 2005\Projects\EncoreVC_j41\Release\RSP0000721396112.rsp” /nologo /errorReport:prompt”

Creating command line “rc.exe /d “NDEBUG” /d “_VC80_UPGRADE=0x0600” /l 0x409 /fo”.\Release/EncoreVC.res" “.\EncoreVC.rc”"

Creating temporary file “c:\Documents and Settings\Bruce Wheaton\My Documents\Visual Studio 2005\Projects\EncoreVC_j41\Release\RSP0000731396112.rsp” with contents

[

/OUT:".\Release/EncoreVC.exe" /INCREMENTAL:NO /LIBPATH:"…/…/bin" /MANIFEST /MANIFESTFILE:".\Release\EncoreVC.exe.intermediate.manifest" /PDB:".\Release/EncoreVC.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 kernel32.lib “.\lib\r\sockets.lib” “…\juce\bin\jucelib_static_win32.lib”

]

Creating command line “link.exe @“c:\Documents and Settings\Bruce Wheaton\My Documents\Visual Studio 2005\Projects\EncoreVC_j41\Release\RSP0000731396112.rsp” /NOLOGO /ERRORREPORT:PROMPT”

Output Window Compiling…

blah blah some more compiling, a few type rounding warnings…

Generating Code…

Compiling resources…

Linking…

sockets.lib(PoolSocket.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(ResolvSocket.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(CircularBuffer.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(Base64.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(TcpSocket.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(Utility.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(Parse.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(ResolvServer.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

EncoreVC_Document.obj : error LNK2019: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ) referenced in function “private: bool __thiscall std::basic_string,class std::allocator >::_Grow(unsigned int,bool)” (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE_NI_N@Z)

DeviceDirectSocket.obj : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(SocketHandler.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(Socket.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xlen(void)” (?_Xlen@std@@YAXXZ)

sockets.lib(Utility.obj) : error LNK2019: unresolved external symbol “void __cdecl std::_Xran(void)” (?_Xran@std@@YAXXZ) referenced in function __ehhandler$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z

sockets.lib(Parse.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xran(void)” (?_Xran@std@@YAXXZ)

sockets.lib(ResolvSocket.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xran(void)” (?_Xran@std@@YAXXZ)

sockets.lib(CircularBuffer.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xran(void)” (?_Xran@std@@YAXXZ)

DeviceDirectSocket.obj : error LNK2001: unresolved external symbol “void __cdecl std::_Xran(void)” (?_Xran@std@@YAXXZ)

sockets.lib(SocketHandler.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xran(void)” (?_Xran@std@@YAXXZ)

sockets.lib(Socket.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xran(void)” (?_Xran@std@@YAXXZ)

sockets.lib(TcpSocket.obj) : error LNK2001: unresolved external symbol “void __cdecl std::_Xran(void)” (?_Xran@std@@YAXXZ)

.\Release/EncoreVC.exe : fatal error LNK1120: 2 unresolved externals

Results Build log was saved at “file://c:\Documents and Settings\Bruce Wheaton\My Documents\Visual Studio 2005\Projects\EncoreVC_j41\Release\BuildLog.htm”

EncoreVC - 21 error(s), 19 warning(s)

[/code]

No idea, sorry. Could be that the libs you get with vcexpress aren’t quite the same as those with visual studio - I’ve seen some stuff (like the RTAS sdk) that just won’t work in vcexpress…

The other library compiles just fine on it’s own - it’s just when it gets combined with juce. Weird.

Should I ‘upgrade’ to a real VC++? I seem to remember the C++ only flavor being reasonably priced.

Bruce

OK, finally this set, and only this set, of paths got me there. It seems contradictory to the VC++ Express instructions in the Juce Docs, FYI.

Thanks o2e!

include="$(VCInstallDir)include;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include;C:\Program Files\Microsoft Platform SDK\include;c:\juce;c:\DXSDK\Include;C:\SDK\VST Plug-Ins SDK 2.3\vstsdk2.3\vstsdk2.3\source\common" Library="$(VCInstallDir)lib;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib;$(VSInstallDir);$(VSInstallDir)lib;C:\Program Files\Microsoft Platform SDK\lib;c:\juce\bin;c:\DXSDK\Lib"

Bruce (Off back to my Mac, with a sigh of relief)

Looks like you’re mixing up different versions of the Platform SDK there. Maybe the libs you were linking to came from a different version than the headers that you had included?

Well, I’m a bit new to VC++ Express. I got it based on this forum. But all the libs I’m using are compiled right from source code using this same set of paths, in the same solution. I also tried with the XP2 PSDK.

I scoured the actual includes (when I was just using the platform SDK), and then also searched for #pragma comment libs - all I can find is that juce.h does some lib including, so unless that’s finding libs - I dunno, as they say.

With the recommended libs the linker can’t resolve xlen and xran - string related. The web says there’s problems with std::string and T - so that could be juce related, I suppose. Anyway, this set of paths, from someone having similar problems, is all that works.

The ‘other’ lib I’m using is this: http://www.alhem.net/Sockets/ I’m using it because I already have a commercial license (we’ll be getting a couple for juce, soon) and I have it in an app where it’s essentially been bulletproof. If you wanted to add to juce, as I know you prefer to, you’d need UDP sockets, SSL sockets, and you may have to add a central socket running class that uses the select call - that’s regarded as far more efficient than multiple threads for dealing with socket blocking issues. A great start would be to put the interapp socket stuff into a superclass so that scheme could be used without the messaging protocol (which I would have done if I hadn’t ‘sorted’ the libs issue.

Thanks,

Bruce