VC++, linking error with wxWidgets, x64 - c++

I'm compiling a VC++ 10 application on Windows 7 x64 with wxWidgets 2.8. And this is the errors I have. The code is generated using wxFormBuilder.
Update: I try to run it on 32-bit machine as well, still having the same problem.
I have no idea which wxwidgets libraries I'm missing out, or what settings did I do it wrong. Tried both in Debug and Release mode.
I'd really appreciate if someone could point to some hints! Been looking at this problem for a while.
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
1>ControlDialog.obj : error LNK2019: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B) referenced in function "public: void __cdecl ControlDialog::loadFile(class std::basic_string,class std::allocator >)" (?loadFile#ControlDialog##QEAAXV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
1>MainFrame.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
1>MainFrame.obj : error LNK2019: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB) referenced in function "public: __cdecl MainFrame::MainFrame(class wxWindow *,class UIApp *)" (??0MainFrame##QEAA#PEAVwxWindow##PEAVUIApp###Z)
1>UIApp.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>VISUI.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>Helper.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>MainFrame.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>UIApp.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>VISUI.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>Helper.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "class wxMBConvUTF8 & wxConvUTF8" (?wxConvUTF8##3AEAVwxMBConvUTF8##EA)
1>Helper.obj : error LNK2001: unresolved external symbol "class wxMBConvUTF8 & wxConvUTF8" (?wxConvUTF8##3AEAVwxMBConvUTF8##EA)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const wxGLCanvas::sm_eventTable" (?sm_eventTable#wxGLCanvas##1UwxEventTable##B)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "char const * const wxFrameNameStr" (?wxFrameNameStr##3QBDB)
1>VISUI.obj : error LNK2001: unresolved external symbol "char const * const wxFrameNameStr" (?wxFrameNameStr##3QBDB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxPalette wxNullPalette" (?wxNullPalette##3VwxPalette##A)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxCursor wxNullCursor" (?wxNullCursor##3VwxCursor##A)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_NULL" (?wxEVT_NULL##3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_ERASE_BACKGROUND" (?wxEVT_ERASE_BACKGROUND##3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_PAINT" (?wxEVT_PAINT##3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_SIZE" (?wxEVT_SIZE##3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_IDLE" (?wxEVT_IDLE##3HB)
The libraries I'm linking against (64-bit wxwidgets libraries)
wxbase28.lib
wxmsw28_core.lib
wxmsw28_richtext.lib
wxmsw28_html.lib
wxmsw28_gl.lib
wxmsw28_adv.lib
comctl32.lib
Rpcrt4.lib
My compiling settings:
Treat Wchat_t as built in type: Yes
Multi-threaded Debug DLL

I found the solution to my own problem. Just post here in case anyone faces it.
It's not about x64 or x32, neither about wxWidgets. I just need to add these 2 lines in header (before #include <wx/wx.h>)
#define __WXMSW__
#define WXUSINGDLL

How did you build wxWidgets? My understanding is that you will have to change the Visual Studio projects files distributed with wxWidgets, so that it builds in 64-bit mode. Unless you are targeting 32-bit mode. So make sure that you are targeting the same architecture with both your application and wxWidgets (i.e. both should be either 32 or 64 bit).
Also, last I looked, wxWidgets 2.8 doesn't support x64, you will need to upgrade to wxWidgets 2.9 if you want to target x64.
You can also check out the following link: http://wiki.wxwidgets.org/Supporting_x64_and_Win32_within_one_solution

1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
This is an extremely strange external symbol. What is 'class' doing there - it is a C++ keyword. What are all the spaces doing?
My guess is that something horrible happened during compilation. Are you certain you even submitted your source code to a C++ compiler?

Had the same problems on MSVC 2019 as described in the question when try to build from precompiled binaries downloaded from site.
When I compiled from source from ...\build\msw\wx_vc12.sln with "Release" option (NOT "Release DLL", but "Release") and get "vc_x64_lib" folder everything works. In my case no needs specify #define __WXMSW__ and #define WXUSINGDLL, just check you build with Multi-threaded DLL (/MD)

Related

Still linker errors in VisualStudio for grpc despite AutoLink (vcpkg) enabled

I ran as suggested in https://stackoverflow.com/a/67875527/433718
vcpkg install grpc:x64-windows
vcpkg install protobuf protobuf:x64-windows
vcpkg install protobuf[zlib] protobuf[zlib]:x64-windows
vcpkg integrate install
Hence, those packages are installed now on my computer:
vcpkg list
abseil:x64-windows 2021-03-24#1 an open-source collection designed to augment th...
c-ares:x64-windows 1.17.1#2 A C library for asynchronous DNS requests
grpc:x64-windows 1.37.0#3 An RPC library and framework
grpc[codegen]:x64-windows Build code generator machinery
openssl:x64-windows 1.1.1k#8 OpenSSL is an open source project that provides ...
protobuf:x64-windows 3.15.8#4 Protocol Buffers - Google's data interchange format
protobuf:x86-windows 3.15.8#4 Protocol Buffers - Google's data interchange format
protobuf[zlib]:x64-windows ZLib based features like Gzip streams
protobuf[zlib]:x86-windows ZLib based features like Gzip streams
re2:x64-windows 2020-10-01 RE2 is a fast, safe, thread-friendly alternative...
upb:x64-windows 2020-12-19#1 μpb (often written 'upb') is a small protobuf i...
zlib:x64-windows 1.2.11#11 A compression library
zlib:x86-windows 1.2.11#11 A compression library
Here's my code:
#include <grpcpp/grpcpp.h>
using grpc::ServerBuilder;
int main(int argc, char** argv) {
ServerBuilder builder;
return 0;
}
I haven't configured any paths (e.g. Additional Dependencies) in the properties as I am using vcpkg (I suppose that's the point of using vcpkg). Here's the config page of vcpkg:
My project doesn't build in Visul Studio 2019 due to 27 unresolved externals...
1>grpc.lib(iomgr_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSAStartup referenced in function "void __cdecl winsock_init(void)" (?winsock_init##YAXXZ)
1>grpc.lib(iomgr_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSACleanup referenced in function "void __cdecl winsock_shutdown(void)" (?winsock_shutdown##YAXXZ)
1>grpc.lib(socket_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_bind referenced in function "void __cdecl probe_ipv6_once(void)" (?probe_ipv6_once##YAXXZ)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_bind
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_bind
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_bind
1>grpc.lib(socket_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_closesocket referenced in function "void __cdecl grpc_winsocket_shutdown(struct grpc_winsocket *)" (?grpc_winsocket_shutdown##YAXPEAUgrpc_winsocket###Z)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_closesocket
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_closesocket
1>address_sorting.lib(address_sorting_windows.c.obj) : error LNK2001: unresolved external symbol __imp_closesocket
1>grpc.lib(socket_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_socket referenced in function "void __cdecl probe_ipv6_once(void)" (?probe_ipv6_once##YAXXZ)
1>address_sorting.lib(address_sorting_windows.c.obj) : error LNK2001: unresolved external symbol __imp_socket
1>grpc.lib(resolve_address_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(tcp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(socket_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(iocp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(socket_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(tcp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAIoctl
1>grpc.lib(socket_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSASocketA referenced in function "void __cdecl grpc_wsa_socket_flags_init(void)" (?grpc_wsa_socket_flags_init##YAXXZ)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSASocketA
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSASocketA
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSASocketA
1>grpc.lib(iocp_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSAGetOverlappedResult referenced in function "enum grpc_iocp_work_status __cdecl grpc_iocp_work(__int64)" (?grpc_iocp_work##YA?AW4grpc_iocp_work_status##_J#Z)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetOverlappedResult
1>grpc.lib(tcp_client_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetOverlappedResult
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSAGetOverlappedResult
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_getpeername referenced in function "void __cdecl on_accept(void *,struct grpc_error *)" (?on_accept##YAXPEAXPEAUgrpc_error###Z)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_getsockname referenced in function "struct grpc_error * __cdecl prepare_socket(unsigned __int64,struct grpc_resolved_address const *,int *)" (?prepare_socket##YAPEAUgrpc_error##_KPEBUgrpc_resolved_address##PEAH#Z)
1>grpc.lib(tcp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_getsockname
1>address_sorting.lib(address_sorting_windows.c.obj) : error LNK2001: unresolved external symbol __imp_getsockname
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_listen referenced in function "struct grpc_error * __cdecl prepare_socket(unsigned __int64,struct grpc_resolved_address const *,int *)" (?prepare_socket##YAPEAUgrpc_error##_KPEBUgrpc_resolved_address##PEAH#Z)
1>grpc.lib(tcp_server_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_setsockopt referenced in function "void __cdecl on_accept(void *,struct grpc_error *)" (?on_accept##YAXPEAXPEAUgrpc_error###Z)
1>grpc.lib(tcp_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_setsockopt
1>grpc.lib(resolve_address_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_getaddrinfo referenced in function "struct grpc_error * __cdecl windows_blocking_resolve_address(char const *,char const *,struct grpc_resolved_addresses * *)" (?windows_blocking_resolve_address##YAPEAUgrpc_error##PEBD0PEAPEAUgrpc_resolved_addresses###Z)
1>grpc.lib(resolve_address_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_freeaddrinfo referenced in function "struct grpc_error * __cdecl windows_blocking_resolve_address(char const *,char const *,struct grpc_resolved_addresses * *)" (?windows_blocking_resolve_address##YAPEAUgrpc_error##PEBD0PEAPEAUgrpc_resolved_addresses###Z)
1>grpc.lib(tcp_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSARecv referenced in function "void __cdecl on_read(void *,struct grpc_error *)" (?on_read##YAXPEAXPEAUgrpc_error###Z)
1>grpc.lib(tcp_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSASend referenced in function "void __cdecl on_write(void *,struct grpc_error *)" (?on_write##YAXPEAXPEAUgrpc_error###Z)
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2001: unresolved external symbol __imp_WSASend
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_htonl referenced in function "unsigned int __cdecl grpc_htonl(unsigned int)" (?grpc_htonl##YAII#Z)
1>address_sorting.lib(address_sorting.c.obj) : error LNK2001: unresolved external symbol __imp_htonl
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_htons referenced in function "unsigned short __cdecl grpc_htons(unsigned short)" (?grpc_htons##YAGG#Z)
1>grpc.lib(grpc_ares_wrapper.cc.obj) : error LNK2001: unresolved external symbol __imp_htons
1>grpc.lib(parse_address.cc.obj) : error LNK2001: unresolved external symbol __imp_htons
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_ntohl referenced in function "unsigned int __cdecl grpc_ntohl(unsigned int)" (?grpc_ntohl##YAII#Z)
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_ntohs referenced in function "unsigned short __cdecl grpc_ntohs(unsigned short)" (?grpc_ntohs##YAGG#Z)
1>grpc.lib(grpc_ares_wrapper.cc.obj) : error LNK2001: unresolved external symbol __imp_ntohs
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_inet_pton referenced in function "int __cdecl grpc_inet_pton(int,char const *,void *)" (?grpc_inet_pton##YAHHPEBDPEAX#Z)
1>grpc.lib(socket_utils_windows.cc.obj) : error LNK2019: unresolved external symbol inet_ntop referenced in function "char const * __cdecl grpc_inet_ntop(int,void const *,char *,unsigned __int64)" (?grpc_inet_ntop##YAPEBDHPEBXPEAD_K#Z)
1>grpc.lib(ssl_transport_security.cc.obj) : error LNK2001: unresolved external symbol inet_ntop
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSASetLastError referenced in function "public: __cdecl grpc_core::WSAErrorContext::~WSAErrorContext(void)" (??1WSAErrorContext#grpc_core##QEAA#XZ)
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSAConnect referenced in function "public: int __cdecl grpc_core::GrpcPolledFdWindows::ConnectUDP(class grpc_core::WSAErrorContext *,struct sockaddr const *,int)" (?ConnectUDP#GrpcPolledFdWindows#grpc_core##QEAAHPEAVWSAErrorContext#2#PEBUsockaddr##H#Z)
1>grpc.lib(grpc_ares_ev_driver_windows.cc.obj) : error LNK2019: unresolved external symbol __imp_WSARecvFrom referenced in function "public: void __cdecl grpc_core::GrpcPolledFdWindows::ContinueRegisterForOnReadableLocked(void)" (?ContinueRegisterForOnReadableLocked#GrpcPolledFdWindows#grpc_core##QEAAXXZ)
1>address_sorting.lib(address_sorting_windows.c.obj) : error LNK2019: unresolved external symbol __imp_connect referenced in function address_sorting_create_source_addr_factory_for_current_platform
I build in the Debug and x64 configuration.
What am I missing? I thought vcpkg shall make life easier?
It seems to be a problem of the grpc package.
2nd part of the accepted answer of Linking gRPC on Windows for VisualC++ exactly fixed my problem.
I added #pragma comment(lib, "Ws2_32.lib") to my cpp-file and the problem was gone.
It also can be fixed like so (I've taken the screenshot from Unresolved external symbol LNK2019):

Pixar USD LNK2019: unresolved external symbol

I'm working on a C++ program that creates a .usda file using the Python 3 pre-built libraries from Nvidia (https://developer.nvidia.com/usd). There are a lot of external libraries, and I can't pin down which one is causing a bunch of compiler issues. There are a handful of header files (stage.h, mesh.h to be specific) that will prevent my program from compiling. Other header files I've used from the package don't cause these errors.
I gather from research that I'm potentially missing an include/lib directory or something was compiled on a different version, but how can I find which file(s) are missing or compiled improperly?
I'm using Windows 10, Visual Studio 2017, Python 3.6, and Boost 1.68. Nvidia libraries are in C:\USDP3
Includes: C:\USDP3\include C:\Program Files\boost_1_68_0
Libraries: C:\USDP3\lib C:\Program Files\boost_1_68_0 C:\USDP3\libs
Example code:
#include "pch.h"
#define NOMINMAX
#define TBB_USE_ASSERT 0
#define TBB_USE_THREADING_TOOLS 0
#include "pxr/pxr.h"
#include "pxr/usd/usd/stage.h"
#include <iostream>
PXR_NAMESPACE_USING_DIRECTIVE
int main(int argc, char* argv[])
{
//Create Stage
UsdStage::CreateNew("Test.usda");
std::cout << "Hello World!\n";
}
Causes these errors:
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static char * * pxrInternal_v0_19__pxrReserved__::Sdf_Pool<struct pxrInternal_v0_19__pxrReserved__::Sdf_PathPropTag,24,8,16384>::_regionStarts" (__imp_?_regionStarts#?$Sdf_Pool#USdf_PathPropTag#pxrInternal_v0_19__pxrReserved__##$0BI#$07$0EAAA##pxrInternal_v0_19__pxrReserved__##0PAPEADA)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PrimPathNode::~Sdf_PrimPathNode(void)" (__imp_??1Sdf_PrimPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_MapperArgPathNode::~Sdf_MapperArgPathNode(void)" (__imp_??1Sdf_MapperArgPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_ExpressionPathNode::~Sdf_ExpressionPathNode(void)" (__imp_??1Sdf_ExpressionPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PrimPartPathNode::operator delete(void *)" (__imp_??3Sdf_PrimPartPathNode#pxrInternal_v0_19__pxrReserved__##SAXPEAX#Z)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PrimPropertyPathNode::~Sdf_PrimPropertyPathNode(void)" (__imp_??1Sdf_PrimPropertyPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_TargetPathNode::~Sdf_TargetPathNode(void)" (__imp_??1Sdf_TargetPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PropPartPathNode::operator delete(void *)" (__imp_??3Sdf_PropPartPathNode#pxrInternal_v0_19__pxrReserved__##SAXPEAX#Z)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl pxrInternal_v0_19__pxrReserved__::Tf_RefPtr_UniqueChangedCounter::_RemoveRef(class pxrInternal_v0_19__pxrReserved__::TfRefBase const *)" (__imp_?_RemoveRef#Tf_RefPtr_UniqueChangedCounter#pxrInternal_v0_19__pxrReserved__##SA_NPEBVTfRefBase#2##Z)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_RelationalAttributePathNode::~Sdf_RelationalAttributePathNode(void)" (__imp_??1Sdf_RelationalAttributePathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_MapperPathNode::~Sdf_MapperPathNode(void)" (__imp_??1Sdf_MapperPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: void __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PathNode::_RemovePathTokenFromTable(void)const " (__imp_?_RemovePathTokenFromTable#Sdf_PathNode#pxrInternal_v0_19__pxrReserved__##IEBAXXZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class pxrInternal_v0_19__pxrReserved__::TfRefPtr<class pxrInternal_v0_19__pxrReserved__::UsdStage> __cdecl pxrInternal_v0_19__pxrReserved__::UsdStage::CreateNew(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum pxrInternal_v0_19__pxrReserved__::UsdStage::InitialLoadSet)" (__imp_?CreateNew#UsdStage#pxrInternal_v0_19__pxrReserved__##SA?AV?$TfRefPtr#VUsdStage#pxrInternal_v0_19__pxrReserved__###2#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##W4InitialLoadSet#12##Z)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PrimVariantSelectionNode::~Sdf_PrimVariantSelectionNode(void)" (__imp_??1Sdf_PrimVariantSelectionNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static char * * pxrInternal_v0_19__pxrReserved__::Sdf_Pool<struct pxrInternal_v0_19__pxrReserved__::Sdf_PathPrimTag,24,8,16384>::_regionStarts" (__imp_?_regionStarts#?$Sdf_Pool#USdf_PathPrimTag#pxrInternal_v0_19__pxrReserved__##$0BI#$07$0EAAA##pxrInternal_v0_19__pxrReserved__##0PAPEADA)'
You should have following things in your compilation step setup properly:
Preprocessor flags:
TBB_USE_DEBUG=0
YY_NO_UNISTD_H
BOOST_ALL_DYN_LINK
BOOST_PYTHON_NO_PY_SIGNATURES
BUILD_OPTLEVEL_DEV
NDEBUG
NOMINMAX
_CRT_SECURE_NO_WARNINGS
_SCL_SECURE_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
_CRT_NONSTDC_NO_DEPRECATE
NO_WARN_MBCS_MFC_DEPRECATION
Include Directories: <usd_install>\include;<usd_install>\include\boost-1_70;<Python374>\include
Libraries to link against: usd_ms.lib(when USD is compiled as monolithic shared lib)
Else, basic ones: arch.lib;pxOsd.lib;sdf.lib;usd.lib;vt.lib;tf.lib;
Render: hd.lib;hdx.lib;
More: gf.lib;cameraUtil.lib;trace.lib;hf.lib;(depending on which ones you are using.)
Their counterpart dlls should discoverable or best should be in same dir. as your executable.
Check USD's cmake files to get better idea on what to include.

Using jsoncpp dll to build another dll project : link time issues

I am using json-cpp lib to build another dll project in Visual studio 2008.
Linker settings :
output file is a dll
Input tab : I have added the json cpp lib in additional dependencies
I get the following unresolved symbols given below
Also tried defining JSON_DLL to JSON_API, but it didnt work.
If there is a fix for this problem?
.. error LNK2001: unresolved external symbol "protected: bool cdecl Json::ValueIteratorBase::isEqual(class Json::ValueIteratorBase const &)const " (?isEqual#ValueIteratorBase#Json##IEBA_NAEBV12##Z)
.. error LNK2001: unresolved external symbol "protected: void cdecl Json::ValueIteratorBase::increment(void)" (?increment#ValueIteratorBase#Json##IEAAXXZ)
.. error LNK2001: unresolved external symbol "protected: class Json::Value & cdecl Json::ValueIteratorBase::deref(void)const " (?deref#ValueIteratorBase#Json##IEBAAEAVValue#2#XZ)
.. error LNK2001: unresolved external symbol "public: cdecl Json::ValueIterator::ValueIterator(class Json::ValueIterator const &)" (??0ValueIterator#Json##QEAA#AEBV01##Z)
.. error LNK2001: unresolved external symbol "public: virtual class _STL::basic_string,class _STL::allocator > cdecl Json::FastWriter::write(class Json::Value const &)" (?write#FastWriter#Json##UEAA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL##AEBVValue#2##Z)
.. error LNK2001: unresolved external symbol "public: class _STL::basic_string,class _STL::allocator > cdecl Json::Value::asString(void)const " (?asString#Value#Json##QEBA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL##XZ)
.. error LNK2001: unresolved external symbol "public: class Json::Value cdecl Json::ValueIteratorBase::key(void)const " (?key#ValueIteratorBase#Json##QEBA?AVValue#2#XZ)
.. error LNK2001: unresolved external symbol "public: class Json::Value & cdecl Json::Value::operator" (??AValue#Json##QEAAAEAV01#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL###Z)
.. error LNK2001: unresolved external symbol "public: class Json::Value & cdecl Json::Value::operator" (??AValue#Json##QEAAAEAV01#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL###Z)
.. error LNK2001: unresolved external symbol "public: bool cdecl Json::Reader::parse(class _STL::basic_string,class _STL::allocator > const &,class Json::Value &,bool)" (?parse#Reader#Json##QEAA_NAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL##AEAVValue#2#_N#Z)

Linker errors with wxTreeListCtrl

Developing an app with wxWidgets even though im fairly new too the library, and need some help fixing these linker problem;
i tried google first with no luck.
1>mainwindow.obj : error LNK2001: unresolved external symbol "char const * const wxTreeListCtrlNameStr" (?wxTreeListCtrlNameStr##3QBDB)
1>mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxTreeListCtrl::GetEventHashTable(void)const " (?GetEventHashTable#wxTreeListCtrl##MBEAAVwxEventHashTable##XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxTreeListCtrl::GetEventTable(void)const " (?GetEventTable#wxTreeListCtrl##MBEPBUwxEventTable##XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "private: int __thiscall wxTreeListCtrl::DoInsertColumn(class wxString const &,int,int,enum wxAlignment,int)" (?DoInsertColumn#wxTreeListCtrl##AAEHABVwxString##HHW4wxAlignment##H#Z)
1>mainwindow.obj : error LNK2001: unresolved external symbol "private: virtual class wxWindowList __thiscall wxTreeListCtrl::GetCompositeWindowParts(void)const " (?GetCompositeWindowParts#wxTreeListCtrl##EBE?AVwxWindowList##XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "private: void __thiscall wxTreeListCtrl::Init(void)" (?Init#wxTreeListCtrl##AAEXXZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall wxTreeListCtrl::~wxTreeListCtrl(void)" (??1wxTreeListCtrl##UAE#XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxTreeListCtrl::Create(class wxWindow *,int,class wxPoint const &,class wxSize const &,long,class wxString const &)" (?Create#wxTreeListCtrl##QAE_NPAVwxWindow##HABVwxPoint##ABVwxSize##JABVwxString###Z)
i tried to format this into a code, but its so hard to do on this site
You need to include the advanced library in the list of wx libraries linked to.
This is mentioned in the wxTreeListCtrl documentation at http://docs.wxwidgets.org/trunk/classwx_tree_list_ctrl.html
The documentation of every wxwidgets class mentions which library needs to be linked with when you use the class.

Can I use __stdcall convention while using Xerces-C 3.0? I get linker errors

In my project it is crucial I use __stdcall. However, I get this:
1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static void __cdecl xercesc_3_0::XMLString::release(unsigned short * *,class xercesc_3_0::MemoryManager * const)" (?release#XMLString#xercesc_3_0##SAXPEAPEAGQEAVMemoryManager#2##Z)
1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static char * __cdecl xercesc_3_0::XMLString::transcode(unsigned short const * const,class xercesc_3_0::MemoryManager * const)" (?transcode#XMLString#xercesc_3_0##SAPEADQEBGQEAVMemoryManager#2##Z)
1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static unsigned short * __cdecl xercesc_3_0::XMLString::transcode(char const * const,class xercesc_3_0::MemoryManager * const)" (?transcode#XMLString#xercesc_3_0##SAPEAGQEBDQEAVMemoryManager#2##Z)
1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static char const * const xercesc_3_0::XMLUni::fgXercescDefaultLocale" (?fgXercescDefaultLocale#XMLUni#xercesc_3_0##2QBDB)
1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static class xercesc_3_0::MemoryManager * xercesc_3_0::XMLPlatformUtils::fgMemoryManager" (?fgMemoryManager#XMLPlatformUtils#xercesc_3_0##2PEAVMemoryManager#2#EA)
1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static class xercesc_3_0::DOMImplementation * __cdecl xercesc_3_0::DOMImplementationRegistry::getDOMImplementation(unsigned short const *)" (?getDOMImplementation#DOMImplementationRegistry#xercesc_3_0##SAPEAVDOMImplementation#2#PEBG#Z)
1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static unsigned short const * const xercesc_3_0::XMLUni::fgDOMWRTFormatPrettyPrint" (?fgDOMWRTFormatPrettyPrint#XMLUni#xercesc_3_0##2QBGB)
1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static unsigned short const * const xercesc_3_0::XMLUni::fgDOMXMLDeclaration" (?fgDOMXMLDeclaration#XMLUni#xercesc_3_0##2QBGB)
Any help?
Xerces is open source, so why not just compile your own variant that uses __stdcall as the default convention, then you won't have the linkage errors.
It even comes with projects for every Windows IDE (including MSVC, which it appears you are using), so its merely a matter of loading it up, change one global option and hitting compile (you may need to change some places where __cdecl must be explicitly used, but the compiler will error on these locations when you build it).