I'm trying to compile the zeromq sources and I have the following error:
I'm using Visual studio 2013 update 4 / windows 7 x64
First of all I compile the libsodium library satisfactorily.
Then I link the libsodium header files directory path to additional dependencies and libsodium.lib to additional library directories. I also specify the name of library in additional dependencies.
I try to compile it under win32 architecture and x64 architecture but I get the same errors.
I know that a __imp prefix is used as a bridge to the function that I want to use so if I linked the libraries appropiately why do I get this error?
Console log:
1>Creating library E:\zmq\libzmq\builds\msvc\vs2013\libzmq\..\..\..\..\bin\Win32\Debug\v120\dynamic\libzmq.lib and object E:\zmq\libzmq\builds\msvc\vs2013\libzmq\..\..\..\..\bin\Win32\Debug\v120\dynamic\libzmq.exp
1>ctx.obj : error LNK2019: unresolved external symbol __imp__randombytes_close referenced in function "public: __thiscall zmq::ctx_t::~ctx_t(void)" (??1ctx_t#zmq##QAE#XZ)
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__sodium_init referenced in function "public: __thiscall zmq::curve_client_t::curve_client_t(struct zmq::options_t const &)" (??0curve_client_t#zmq##QAE#ABUoptions_t#1##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__sodium_init
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_keypair referenced in function "public: __thiscall zmq::curve_client_t::curve_client_t(struct zmq::options_t const &)" (??0curve_client_t#zmq##QAE#ABUoptions_t#1##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_keypair
1>zmq_utils.obj : error LNK2001: unresolved external symbol __imp__crypto_box_keypair
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_beforenm referenced in function "private: int __thiscall zmq::curve_client_t::process_welcome(unsigned char const *,unsigned int)" (?process_welcome#curve_client_t#zmq##AAEHPBEI#Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_beforenm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box referenced in function "private: int __thiscall zmq::curve_client_t::produce_hello(class zmq::msg_t *)" (?produce_hello#curve_client_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_open referenced in function "private: int __thiscall zmq::curve_client_t::process_welcome(unsigned char const *,unsigned int)" (?process_welcome#curve_client_t#zmq##AAEHPBEI#Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_open
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_afternm referenced in function "public: virtual int __thiscall zmq::curve_client_t::encode(class zmq::msg_t *)" (?encode#curve_client_t#zmq##UAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_afternm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__crypto_box_open_afternm referenced in function "public: virtual int __thiscall zmq::curve_client_t::decode(class zmq::msg_t *)" (?decode#curve_client_t#zmq##UAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__crypto_box_open_afternm
1>curve_client.obj : error LNK2019: unresolved external symbol __imp__randombytes referenced in function "private: int __thiscall zmq::curve_client_t::produce_initiate(class zmq::msg_t *)" (?produce_initiate#curve_client_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2001: unresolved external symbol __imp__randombytes
1>curve_server.obj : error LNK2019: unresolved external symbol __imp__crypto_secretbox referenced in function "private: int __thiscall zmq::curve_server_t::produce_welcome(class zmq::msg_t *)" (?produce_welcome#curve_server_t#zmq##AAEHPAVmsg_t#2##Z)
1>curve_server.obj : error LNK2019: unresolved external symbol __imp__crypto_secretbox_open referenced in function "private: int __thiscall zmq::curve_server_t::process_initiate(class zmq::msg_t *)" (?process_initiate#curve_server_t#zmq##AAEHPAVmsg_t#2##Z)
Thanks in advance.
You're probably compiling libsodium in a static way.
Try to compile it dinamically and link it again.
Such errors are also able to occur when you have a wrong set calling convention at your project.
Related
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):
I'm sure I'm missing something trivial, but I can't put my finger on what.
I'm building a project with four external libraries using CLion. I'm trying to link Eigen, GLEW, GLFW, and libigl. I'm using the VC++ compiler in VS 2015.
This is one iteration of my cmake file:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
INCLUDE_DIRECTORIES(external/glew_2_1_0/lib/Release/x64)
link_libraries(external/glew_2_1_0/lib/Release/x64)
I have added the glew libraries (both 32 and 64 bit) to their respective folders in VC++. I've also added the glew32.dll files to (64 and 32 bit) to their respective folders in the system folders. I don't think I need to do this if I define where to look for them in my Cmake file, but I'm not entirely sure.
This is my folder structure in CLion:
CLion folder structure.
Here's what main.cpp contains in case it matters:
#include <igl/readOFF.h>
#include <igl/viewer/Viewer.h>
Eigen::MatrixXd V;
Eigen::MatrixXi F;
int main(int argc, char *argv[])
{
// Load a mesh in OFF format
igl::readOFF("bunny.off", V, F);
// Plot the mesh
igl::viewer::Viewer viewer;
viewer.data.set_mesh(V, F);
viewer.launch();
}
These are the linker errors I get.
[100%] Linking CXX executable Lab1.exe
"D:\Actual Program Files\JetBrains\CLion 2017.3.1\bin\cmake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\Lab1.dir --manifests -- D:\ACTUAL~1\VISUAL~2\VC\bin\link.exe /nologo #CMakeFiles\Lab1.dir\objects1.rsp #C:\Users\Mohammed\AppData\Local\Temp\nm6742.tmp
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glBindTexture#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glBlendFunc#8 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glClear#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::clear_framebuffers(void)" (?clear_framebuffers#ViewerCore#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glClearColor#16 referenced in function "public: void __thiscall igl::viewer::ViewerCore::clear_framebuffers(void)" (?clear_framebuffers#ViewerCore#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDeleteTextures#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::free_buffers(void)" (?free_buffers#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDisable#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glDrawElements#16 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glEnable#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGenTextures#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::init_buffers(void)" (?init_buffers#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGetError#0 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glGetString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glLineWidth#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPixelStorei#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPointSize#4 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPolygonMode#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glPolygonOffset#8 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::draw_mesh(bool)" (?draw_mesh#OpenGL_state#viewer#igl##QAEX_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glTexImage2D#36 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glTexParameteri#12 referenced in function "public: void __thiscall igl::viewer::OpenGL_state::bind_mesh(void)" (?bind_mesh#OpenGL_state#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol __imp__glViewport#16 referenced in function "public: void __thiscall igl::viewer::ViewerCore::draw(class igl::viewer::ViewerData &,class igl::viewer::OpenGL_state &,bool)" (?draw#ViewerCore#viewer#igl##QAEXAAVViewerData#23#AAVOpenGL_state#23#_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewInit#0 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewGetErrorString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glewGetString#4 referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwTerminate referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetErrorCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetPrimaryMonitor referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetVideoMode referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWindowHint referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwCreateWindow referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwDestroyWindow referenced in function "public: void __thiscall igl::viewer::Viewer::launch_shut(void)" (?launch_shut#Viewer#viewer#igl##QAEXXZ)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWindowShouldClose referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetWindowShouldClose referenced in function "void __cdecl glfw_key_callback(struct GLFWwindow *,int,int,int,int)" (?glfw_key_callback##YAXPAUGLFWwindow##HHHH#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetWindowSize referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetFramebufferSize referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwGetWindowAttrib referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetWindowSizeCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwPollEvents referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwWaitEvents referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetInputMode referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetKeyCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetCharModsCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetMouseButtonCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetCursorPosCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetScrollCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSetDropCallback referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwMakeContextCurrent referenced in function "public: int __thiscall igl::viewer::Viewer::launch_init(bool,bool)" (?launch_init#Viewer#viewer#igl##QAEH_N0#Z)
main.cpp.obj : error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function "public: bool __thiscall igl::viewer::Viewer::launch_rendering(bool)" (?launch_rendering#Viewer#viewer#igl##QAE_N_N#Z)
main.cpp.obj : error LNK2001: unresolved external symbol ___glewActiveTexture
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindBuffer
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBufferData
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteBuffers
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGenBuffers
main.cpp.obj : error LNK2001: unresolved external symbol ___glewAttachShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCompileShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCreateProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewCreateShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteShader
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDisableVertexAttribArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetAttribLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetProgramInfoLog
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetProgramiv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetShaderInfoLog
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetShaderiv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGetUniformLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewLinkProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewShaderSource
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform1f
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform1i
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform3fv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniform4f
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUniformMatrix4fv
main.cpp.obj : error LNK2001: unresolved external symbol ___glewUseProgram
main.cpp.obj : error LNK2001: unresolved external symbol ___glewVertexAttribPointer
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindFragDataLocation
main.cpp.obj : error LNK2001: unresolved external symbol ___glewProgramParameteri
main.cpp.obj : error LNK2001: unresolved external symbol ___glewBindVertexArray
main.cpp.obj : error LNK2001: unresolved external symbol ___glewDeleteVertexArrays
main.cpp.obj : error LNK2001: unresolved external symbol ___glewGenVertexArrays
main.cpp.obj : error LNK2001: unresolved external symbol _glewExperimental
Lab1.exe : fatal error LNK1120: 81 unresolved externals
LINK Pass 1 failed. with 1120
NMAKE : fatal error U1077: '"D:\Actual Program Files\JetBrains\CLion 2017.3.1\bin\cmake\bin\cmake.exe"' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Actual Program Files\Visual Studio 2015\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
Thanks for the help.
EDIT:
Tsyvarev helped me out with the obvious errors. Changed everything to 32-bit too. Down to 47 unresolved externals. Will update once it's working.
Current Cmake:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
link_libraries(../external/glew_2_1_0/lib/Release/Win32/glew32s)
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
EDIT: SOLVED It all works! Was missing some libraries. Decided to link them locally. Here's the cmake for the next pour soul that comes across this:
cmake_minimum_required(VERSION 3.9)
project(Lab1)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
link_libraries(../external/glew_2_1_0/lib/Release/Win32/glew32s)
link_libraries(../external/glfw/lib-vc2015/glfw3)
link_libraries(../external/openGL/OPENGL32)
link_libraries(../external/openGL/glut32)
link_libraries(../external/openGL/glu32)
find_package(OpenGL REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS})
#target_link_libraries(${PROJECTNAME} ${OPENGL_LIBRARIES})
add_executable(Lab1 main.cpp)
include_directories(external/libigl/include)
include_directories(external/glfw/include/)
include_directories(external/eigen-git-mirror/)
include_directories(external/glew_2_1_0/include)
Thanks for the help!
Command link_libraries affects only on futher targets, so it should be issued before add_executable call.
Also, link_libraries accepts library files, not a directory with them.
I am quite new to C++ so I downloaded a sample C++ program. The sample program seems to hit the following error when it is compiling :-
Error 22 error LNK2019: unresolved external symbol _acsEnumServerNames#12 referenced in function "protected: virtual int __thiscall COpenTsrv::OnInitDialog(void)" (?OnInitDialog#COpenTsrv##MAEHXZ) Opentsrv.obj
I traced it to the referred function but I do not know anything wrong with it ?
BOOL COpenTsrv::OnInitDialog()
{
CDialog::OnInitDialog();
CenterWindow();
acsEnumServerNames(ST_CSTA, AddToList, (unsigned long) (CComboBox*)&m_TserverListControl);
UpdateData(FALSE);
The following is the build log. Apparently there are still other errors but would like to start with the first one.
1>Generating Code...
1>Compiling resources...
1>Compiling manifest to resources...
1>Linking...
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsEnumServerNames#12 referenced in function "protected: virtual int __thiscall COpenTsrv::OnInitDialog(void)" (? OnInitDialog#COpenTsrv##MAEHXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsQueryAuthInfo#8 referenced in function "protected: void __thiscall COpenTsrv::OnSelchangeTserverlist(void)" (?OnSelchangeTserverlist#COpenTsrv##IAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsAbortStream#8 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK#COpenTsrv##MAEXXZ)
1>Tsapi.obj : error LNK2001: unresolved external symbol _acsAbortStream#8
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsEventNotify#16 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK#COpenTsrv##MAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _acsOpenStream#60 referenced in function "protected: virtual void __thiscall COpenTsrv::OnOK(void)" (?OnOK#COpenTsrv##MAEXXZ)
1>Opentsrv.obj : error LNK2019: unresolved external symbol _cstaMonitorDevice#20 referenced in function "protected: long __thiscall COpenTsrv::OnTsapiAcsConfirmation(unsigned int,long)" (?OnTsapiAcsConfirmation#COpenTsrv##IAEJIJ#Z)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaMakeCall#20 referenced in function "protected: void __thiscall CSampleDlg::OnCall(void)" (?OnCall#CSampleDlg##IAEXXZ)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaClearConnection#16 referenced in function "protected: void __thiscall CSampleDlg::OnHangup(void)" (?OnHangup#CSampleDlg##IAEXXZ)
1>Sampldlg.obj : error LNK2019: unresolved external symbol _cstaAnswerCall#16 referenced in function "protected: void __thiscall CSampleDlg::OnAnswer(void)" (?OnAnswer#CSampleDlg##IAEXXZ)
1>Tsapi.obj : error LNK2019: unresolved external symbol _acsGetEventPoll#20 referenced in function "protected: long __thiscall CTsapiWnd::OnTsapiMsg(unsigned int,long)" (?OnTsapiMsg#CTsapiWnd##IAEJIJ#Z)
1>C:\Users\steventang\Documents\Visual Studio 2005\Projects\TSAPINEW\Debug\TSAPINEW.exe : fatal error LNK1120: 10 unresolved externals
1>Build log was saved at "file://c:\Users\steventang\Documents\Visual Studio 2005\Projects\TSAPINEW\TSAPINEW\Debug\BuildLog.htm"
1>TSAPINEW - 12 error(s), 21 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Any help to point me to the right direction would very much be appreciated.
Thanks
Seems like your compilation was sucessfull. Only the linking did not work.
Probably the linker is complaining because you defined the header of the method "acsEnumServerNames" but you did not provide an implementation of the method.
Maybe you used a header-file but you did not provide the library to which the header belongs ?
Find out to which pakage "acsEnumServerNames" belongs and check if you have the implementation of the method in some .c/.cpp file, or if the implementation should be provided by some library on which you do rely.
This is the first time I have attempted to create a .dll, that will be used as a plugin to a 3rd party app.
I created a .dll project in VS210...New Project -> Win32 Console Application -> .dll + Empty Project options.
Then I added in the files I wanted to use and included the various include / dependency libs the code required. Furthermore, set the linker to include the output .lib
Configuration Properties -> Linker -> Advanced -> Import Library - $(OutDir)$(TargetName).lib
While the .lib is successfully compiled, as soon as VS tries to then build the .dll I get a load of "unresolved external symbol" errors relating to all the defined function names.
ClCompile:
SOMPlugin.cpp
Link:
Creating library F:\Data\My Documents\Visual Studio 2010\Projects\Plugin-SOM - Copy\Release\Plugin-SOM.lib and object F:\Data\My Documents\Visual Studio 2010\Projects\Plugin-SOM - Copy\Release\Plugin-SOM.exp
SOMPlugin.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall SOMPlugin::metaObject(void)const " (?metaObject#SOMPlugin##UBEPBUQMetaObject##XZ)
SOMPlugin.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall SOMPlugin::qt_metacast(char const *)" (?qt_metacast#SOMPlugin##UAEPAXPBD#Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall SOMPlugin::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#SOMPlugin##UAEHW4Call#QMetaObject##HPAPAX#Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::updateView(void)" (?updateView#SOMPlugin##MAEXXZ)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::updatedObject(int,class UpdateType const &)" (?updatedObject#SOMPlugin##MAEXHABVUpdateType###Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::addToolbox(class QString,class QWidget *)" (?addToolbox#SOMPlugin##MAEXVQString##PAVQWidget###Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::log(class QString)" (?log#SOMPlugin##MAEXVQString###Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::log(enum Logtype,class QString)" (?log#SOMPlugin##MAEXW4Logtype##VQString###Z)
SOMPlugin.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall SOMPlugin::~SOMPlugin(void)" (??1SOMPlugin##UAE#XZ) referenced in function "public: virtual void * __thiscall SOMPlugin::`scalar deleting destructor'(unsigned int)" (??_GSOMPlugin##UAEPAXI#Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const SOMPlugin::staticMetaObject" (?staticMetaObject#SOMPlugin##2UQMetaObject##B)
F:\Data\My Documents\Visual Studio 2010\Projects\Plugin-SOM\Release\Plugin-SOM.dll : fatal error LNK1120: 9 unresolved externals
Any help would be much appreciated.
The lib will be generated even if you get linker errors. Let's look at one:
SOMPlugin.obj : error LNK2001: unresolved external symbol "public:
virtual struct QMetaObject const * __thiscall
SOMPlugin::metaObject(void)const "
(?metaObject#SOMPlugin##UBEPBUQMetaObject##XZ)
This is telling you that you haven't implemented the method SOMPlugin::metaObject(void)const. Have you?
The rest are similar, other than
SOMPlugin.obj : error LNK2001: unresolved external symbol "public:
static struct QMetaObject const SOMPlugin::staticMetaObject"
(?staticMetaObject#SOMPlugin##2UQMetaObject##B)
In this case, you need a definition for the static member outside the class definition, in an implementation file.
I am trying to add a sound library to a GLFW / OpenGL project in windows. I have set the sound project to output a static library (.lib). It compiles fine.
In my main project, I add a reference to Sound and a dependency on Sound (to change the build order). I include "..\Sound\sound.h" in my main.cpp and Intellisense is happy with everything. All compiles well. However, the linker is pissed:
1>Link:
1> LINK : ###\Projects\DeathRace\Debug\DeathRace.exe not found or not built by the last incremental link; performing full link
1>Sound.lib(sound.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in base_objects.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alListenerfv referenced in function "public: bool __thiscall SoundAPI::Startup(void)" (?Startup#SoundAPI##QAE_NXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alListener3f referenced in function "public: bool __thiscall SoundAPI::Startup(void)" (?Startup#SoundAPI##QAE_NXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alGetError referenced in function "public: bool __thiscall SoundAPI::Startup(void)" (?Startup#SoundAPI##QAE_NXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alutGetError referenced in function "public: bool __thiscall SoundAPI::Startup(void)" (?Startup#SoundAPI##QAE_NXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alutInit referenced in function "public: bool __thiscall SoundAPI::Startup(void)" (?Startup#SoundAPI##QAE_NXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alutExit referenced in function "public: bool __thiscall SoundAPI::Shutdown(void)" (?Shutdown#SoundAPI##QAE_NXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alDeleteBuffers referenced in function "public: bool __thiscall SoundAPI::Shutdown(void)" (?Shutdown#SoundAPI##QAE_NXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alDeleteSources referenced in function "public: bool __thiscall SoundAPI::Shutdown(void)" (?Shutdown#SoundAPI##QAE_NXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alutCreateBufferFromFile referenced in function "public: unsigned int * __thiscall SoundAPI::LoadSound(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?LoadSound#SoundAPI##QAEPAIV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alSourcei referenced in function "public: unsigned int * __thiscall SoundAPI::CreateSource(void)" (?CreateSource#SoundAPI##QAEPAIXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alSource3f referenced in function "public: unsigned int * __thiscall SoundAPI::CreateSource(void)" (?CreateSource#SoundAPI##QAEPAIXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alSourcef referenced in function "public: unsigned int * __thiscall SoundAPI::CreateSource(void)" (?CreateSource#SoundAPI##QAEPAIXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alGenSources referenced in function "public: unsigned int * __thiscall SoundAPI::CreateSource(void)" (?CreateSource#SoundAPI##QAEPAIXZ)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alSourceQueueBuffers referenced in function "public: bool __thiscall SoundAPI::Queue(unsigned int *,unsigned int *)" (?Queue#SoundAPI##QAE_NPAI0#Z)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alSourcePlay referenced in function "public: bool __thiscall SoundAPI::Play(unsigned int *)" (?Play#SoundAPI##QAE_NPAI#Z)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alSourcePause referenced in function "public: bool __thiscall SoundAPI::Pause(unsigned int *)" (?Pause#SoundAPI##QAE_NPAI#Z)
1>Sound.lib(sound.obj) : error LNK2019: unresolved external symbol __imp__alSourceStop referenced in function "public: bool __thiscall SoundAPI::Stop(unsigned int *)" (?Stop#SoundAPI##QAE_NPAI#Z)
1>###\Projects\DeathRace\Debug\DeathRace.exe : fatal error LNK1120: 17 unresolved externals
I have NO IDEA what to make of this. Lnk2038 is supposed to mean a problem between debug and release, but everything is in debug mode. The lnk2019 should be fine against Sound.lib?
Much obliged!
Everything fine with your library (except you mixing debug and release runtime). You'll have to link a debug build when building a program in debug mode. Same is true for release builds. That's for error LNK2038 and warning LNK4098.
The other errors are caused by the simple fact that you can't link a static library with a static library (here: OpenAL), because that would get extra complicated if two static libraries would refer to the same static code (essentially leading to multiple definitions).
What you have to do for these errors to be solved is simple: Link your resulting executable file to your own Sound.lib as well as the right OpenAL library file and everything should be fine.