C++ error LNK2019 can not run code - c++

Dear developers c++,
I the next problem: trying to compile my project i'm getting the "error LNK2019: unresolved external symbol"
even though all of the declared methods in headers are defined in the .cpp
I attach my code together with the post.
Thank you for any assistance!
https://www.dropbox.com/s/e45oazbdc3b23tz/TSTGeometricLib.rar
p.s. the code is presented as VS2005 solution
the errors i get is next:
1>Wm5Vector3.obj : error LNK2019: unresolved external symbol "public: double const & __thiscall Wm5::Tuple::operatorconst " (??ATuple#Wm5##QBEABNH#Z) referenced in function "public: __thiscall Wm5::Vector3::Vector3(class Wm5::Tuple const &)" (??0Vector3#Wm5##QAE#ABVTuple#1##Z)
1>Wm5Vector3.obj : error LNK2019: unresolved external symbol "public: double & __thiscall Wm5::Tuple::operator" (??ATuple#Wm5##QAEAANH#Z) referenced in function "public: static void __cdecl Wm5::Vector3::ComputeExtremes(int,class Wm5::Vector3 const *,class Wm5::Vector3 &,class Wm5::Vector3 &)" (?ComputeExtremes#Vector3#Wm5##SAXHPBV12#AAV12#1#Z)
1>Wm5Vector3.obj : error LNK2019: unresolved external symbol "class Wm5::Vector3 __cdecl Wm5::operator*(double,class Wm5::Vector3 const &)" (??DWm5##YA?AVVector3#0#NABV10##Z) referenced in function "public: static void __cdecl Wm5::Vector3::Orthonormalize(class Wm5::Vector3 &,class Wm5::Vector3 &,class Wm5::Vector3 &)" (?Orthonormalize#Vector3#Wm5##SAXAAV12#00#Z)

To resolve the problems of the Wm5::Tuple::operator[] the solution is to put the functions in the header file. The linker does not like inline functions in a CPP.
And to resolve the problem of the Vector3 operator* (double scalar, const Vector3& vec); remove the inline from the header file and put the definition like:
inline Vector3 Wm5::operator* (double scalar, const Vector3& vec)
in the CPP file, since you also need to specify the namespace.

Related

Unresolved External Symbol errors while using Catch2

I am trying to do Catch2 Unit Testing in Visual Studio. I have created a small test project to practice. When I try to compile this test project, I get a linker error. I am now trying to diagnose this linker error, but the Catch2.hpp header file contains thousands of lines of code. My hope is that someone who is more familiar with Catch2 or unit testing in general can diagnose what the issue is.
I will describe the process by which I created this project. I created a new project in a new solution. I have 4 files, all in the same directory, listed below.
The class I want to test:
//a.h
#pragma once
class A {
friend int A_Tester_Func1(A a);
public:
A(int num) : my_num_(num) {
}
private:
int my_num_;
};
The test:
//atester.cpp
#pragma once
#include "catch.hpp"
#include "a.h"
int A_Tester_Func1(A a) {
return a.my_num_;
}
TEST_CASE("a contains a positive integer", "[a]") {
//...
A a(3);
REQUIRE(A_Tester_Func1(a) == 3);
}
The main function that runs the tests:
//tester.cpp
#define CATCH_CONFIG_MAIN
#include "catch.hpp" // this should create the main function
The Catch2 Testing Framework:
// catch.hpp
/*
* Catch v2.13.2
* Generated: 2020-10-07 11:32:53.302017
*/
//~17-18k lines of code that from Catch2
#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
When I try to compile this code in Visual Studio using the Local Windows Debugger button, I get a bunch of Unresolved External Symbol linker errors. I believe I read somewhere that Catch2 is "partially compiled." That may have something to do with it, but I don't know. Following this guide (StackOverflow: Best practices for Unit testing with Catch2 in Visual Studio) has worked for me, but I'm trying to understand why the small example above is not successfully linking.
I have included the linker errors below for completeness, although I feel that they will probably not be necessary for the question.
1>atester.obj : error LNK2019: unresolved external symbol "public: __thiscall Catch::StringRef::StringRef(char const *)" (??0StringRef#Catch##QAE#PBD#Z) referenced in function "public: class Catch::BinaryExpr<int const &,int const &> const __thiscall Catch::ExprLhs<int const &>::operator==<int>(int const &)" (??$?8H#?$ExprLhs#ABH#Catch##QAE?BV?$BinaryExpr#ABHABH#1#ABH#Z)
1>atester.obj : error LNK2019: unresolved external symbol "struct Catch::ITestInvoker * __cdecl Catch::makeTestInvoker(void (__cdecl*)(void))" (?makeTestInvoker#Catch##YAPAUITestInvoker#1#P6AXXZ#Z) referenced in function "void __cdecl `anonymous namespace'::`dynamic initializer for 'autoRegistrar1''(void)" (??__EautoRegistrar1#?A0xf9ca9c7d##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: __thiscall Catch::NameAndTags::NameAndTags(class Catch::StringRef const &,class Catch::StringRef const &)" (??0NameAndTags#Catch##QAE#ABVStringRef#1#0#Z) referenced in function "void __cdecl `anonymous namespace'::`dynamic initializer for 'autoRegistrar1''(void)" (??__EautoRegistrar1#?A0xf9ca9c7d##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: __thiscall Catch::AutoReg::AutoReg(struct Catch::ITestInvoker *,struct Catch::SourceLineInfo const &,class Catch::StringRef const &,struct Catch::NameAndTags const &)" (??0AutoReg#Catch##QAE#PAUITestInvoker#1#ABUSourceLineInfo#1#ABVStringRef#1#ABUNameAndTags#1##Z) referenced in function "void __cdecl `anonymous namespace'::`dynamic initializer for 'autoRegistrar1''(void)" (??__EautoRegistrar1#?A0xf9ca9c7d##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Catch::AutoReg::~AutoReg(void)" (??1AutoReg#Catch##UAE#XZ) referenced in function "void __cdecl `anonymous namespace'::`dynamic atexit destructor for 'autoRegistrar1''(void)" (??__FautoRegistrar1#?A0xf9ca9c7d##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Catch::StringMaker<int,void>::convert(int)" (?convert#?$StringMaker#HX#Catch##SA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Catch::Detail::stringify<int>(int const &)" (??$stringify#H#Detail#Catch##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABH#Z)
1>atester.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Catch::ITransientExpression::~ITransientExpression(void)" (??1ITransientExpression#Catch##UAE#XZ) referenced in function "public: virtual __thiscall Catch::BinaryExpr<int const &,int const &>::~BinaryExpr<int const &,int const &>(void)" (??1?$BinaryExpr#ABHABH#Catch##UAE#XZ)
1>atester.obj : error LNK2019: unresolved external symbol "void __cdecl Catch::formatReconstructedExpression(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class Catch::StringRef,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?formatReconstructedExpression#Catch##YAXAAV?$basic_ostream#DU?$char_traits#D#std###std##ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##3#VStringRef#1#1#Z) referenced in function "private: virtual void __thiscall Catch::BinaryExpr<int const &,int const &>::streamReconstructedExpression(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?streamReconstructedExpression#?$BinaryExpr#ABHABH#Catch##EBEXAAV?$basic_ostream#DU?$char_traits#D#std###std###Z)
1>atester.obj : error LNK2019: unresolved external symbol "public: __thiscall Catch::AssertionHandler::AssertionHandler(class Catch::StringRef const &,struct Catch::SourceLineInfo const &,class Catch::StringRef,enum Catch::ResultDisposition::Flags)" (??0AssertionHandler#Catch##QAE#ABVStringRef#1#ABUSourceLineInfo#1#V21#W4Flags#ResultDisposition#1##Z) referenced in function "void __cdecl ____C_A_T_C_H____T_E_S_T____0(void)" (?____C_A_T_C_H____T_E_S_T____0##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: void __thiscall Catch::AssertionHandler::handleExpr(struct Catch::ITransientExpression const &)" (?handleExpr#AssertionHandler#Catch##QAEXABUITransientExpression#2##Z) referenced in function "void __cdecl ____C_A_T_C_H____T_E_S_T____0(void)" (?____C_A_T_C_H____T_E_S_T____0##YAXXZ)
1>atester.obj : error LNK2019: unresolved external symbol "public: void __thiscall Catch::AssertionHandler::handleUnexpectedInflightException(void)" (?handleUnexpectedInflightException#AssertionHandler#Catch##QAEXXZ) referenced in function __catch$?____C_A_T_C_H____T_E_S_T____0##YAXXZ$0
1>atester.obj : error LNK2019: unresolved external symbol "public: void __thiscall Catch::AssertionHandler::complete(void)" (?complete#AssertionHandler#Catch##QAEXXZ) referenced in function __catch$?____C_A_T_C_H____T_E_S_T____0##YAXXZ$0
1>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main##YAHXZ)
What is causing these errors? How do I fix these errors while keeping catch.hpp in the same project as my source files?
In a .cpp file, add this to make the project a Catch2 test runner:
#define CATCH_CONFIG_RUNNER
#include "catch.hpp"
Read more at Supplying main() yourself
I ran into the same problem.
You need to keep #define CATCH_CONFIG_MAIN in the first line of the file, especially before other #include.
atester.cpp must not have the #pragma once directive. It's for header files, and while it may not be your source of trouble, it simply doesn't belong. Since you're not providing enough detail (namely: where's the minimized project file?), I have to be conservative here.
It seems that tester.cpp is not part of the project that you're building. Just because it's a file that exists on disk doesn't mean it's automatically picked up. You have to manually add it to the MSVC project. That's all there's to it. I use Catch2 with MSVS all the time and that's all it takes to make it work.

Unresolved std::exception::exception(char const * const &,int)

Following this instruction, I am migrating a legacy VC++ project to MSVS2017 . I'm getting the following error currently:
eafxisd.lib(isapi.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::exception::exception(char const * const &,int)" (__imp_??0exception#std##QAE#ABQBDH#Z) referenced in function "public: __thiscall std::bad_alloc::bad_alloc(void)" (??0bad_alloc#std##QAE#XZ)
This is the only error left. Any ideas how to resolve it?
Update:
There are also some warnings, if this is relevant:
1>eafxisd.lib(isapi.obj) : warning LNK4217: locally defined symbol ??1exception#std##UAE#XZ (public: virtual __thiscall std::exception::~exception(void)) imported in function "public: virtual __thiscall std::bad_alloc::~bad_alloc(void)" (??1bad_alloc#std##UAE#XZ)
1>eafxisd.lib(isapi.obj) : warning LNK4217: locally defined symbol ??0exception#std##QAE#ABV01##Z (public: __thiscall std::exception::exception(class std::exception const &)) imported in function "public: __thiscall std::bad_alloc::bad_alloc(class std::bad_alloc const &)" (??0bad_alloc#std##QAE#ABV01##Z)
I am linking the following standard libraries:
eafxisd.lib
nafxisd.lib
legacy_stdio_definitions.lib
I ignore legacy MFC libraries:
mfc80d.lib
mfcs80d.lib

Including OpenVDB in DLL; Linking errors with Visual Studio 2015

I am trying to compile, in Visual Studio 2015, a DLL that I am making which acts as a C-compatible wrapper around some functionality from OpenVDB, making it usable in an existing C project. When I build, however, I get the following Linker Errors:
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class std::basic_streambuf<char,struct std::char_traits<char> > > __thiscall openvdb::v4_0_1::io::MappedFile::createBuffer(void)const " (__imp_?createBuffer#MappedFile#io#v4_0_1#openvdb##QBE?AV?$shared_ptr#V?$basic_streambuf#DU?$char_traits#D#std###std###std##XZ) referenced in function "private: void __thiscall openvdb::v4_0_1::tree::LeafBuffer<float,3>::doLoad(void)const " (?doLoad#?$LeafBuffer#M$02#tree#v4_0_1#openvdb##ABEXXZ)
Error LNK2019 unresolved external symbol "__declspec(dllimport) class std::shared_ptr<class openvdb::v4_0_1::io::StreamMetadata> __cdecl openvdb::v4_0_1::io::getStreamMetadataPtr(class std::ios_base &)" (__imp_?getStreamMetadataPtr#io#v4_0_1#openvdb##YA?AV?$shared_ptr#VStreamMetadata#io#v4_0_1#openvdb###std##AAVios_base#5##Z) referenced in function "void __cdecl openvdb::v4_0_1::io::readCompressedValues<float,class openvdb::v4_0_1::util::NodeMask<3> >(class std::basic_istream<char,struct std::char_traits<char> > &,float *,unsigned int,class openvdb::v4_0_1::util::NodeMask<3> const &,bool)" (??$readCompressedValues#MV?$NodeMask#$02#util#v4_0_1#openvdb###io#v4_0_1#openvdb##YAXAAV?$basic_istream#DU?$char_traits#D#std###std##PAMIABV?$NodeMask#$02#util#12#_N#Z)
Error LNK2019 unresolved external symbol "__declspec(dllimport) void __cdecl openvdb::v4_0_1::io::setStreamMetadataPtr(class std::ios_base &,class std::shared_ptr<class openvdb::v4_0_1::io::StreamMetadata> &,bool)" (__imp_?setStreamMetadataPtr#io#v4_0_1#openvdb##YAXAAVios_base#std##AAV?$shared_ptr#VStreamMetadata#io#v4_0_1#openvdb###5#_N#Z) referenced in function "private: void __thiscall openvdb::v4_0_1::tree::LeafBuffer<float,3>::doLoad(void)const " (?doLoad#?$LeafBuffer#M$02#tree#v4_0_1#openvdb##ABEXXZ)
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: static class std::shared_ptr<class openvdb::v4_0_1::math::Transform> __cdecl openvdb::v4_0_1::math::Transform::createLinearTransform(class openvdb::v4_0_1::math::Mat4<double> const &)" (__imp_?createLinearTransform#Transform#math#v4_0_1#openvdb##SA?AV?$shared_ptr#VTransform#math#v4_0_1#openvdb###std##ABV?$Mat4#N#234##Z) referenced in function "public: static class std::shared_ptr<class openvdb::v4_0_1::math::Transform> __cdecl OpenVDB_c::LinearTransform(double,double,double,double,double,double,double,double,double,double,double,double,double,double,double,double)" (?LinearTransform#OpenVDB_c##SA?AV?$shared_ptr#VTransform#math#v4_0_1#openvdb###std##NNNNNNNNNNNNNNNN#Z)
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: void __thiscall openvdb::v4_0_1::GridBase::setTransform(class std::shared_ptr<class openvdb::v4_0_1::math::Transform>)" (__imp_?setTransform#GridBase#v4_0_1#openvdb##QAEXV?$shared_ptr#VTransform#math#v4_0_1#openvdb###std###Z) referenced in function __catch$?setGridTransform#OpenVDB_c##QAE_NHV?$shared_ptr#VTransform#math#v4_0_1#openvdb###std###Z$0
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class openvdb::v4_0_1::GridBase> __thiscall openvdb::v4_0_1::io::File::readGrid(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?readGrid#File#io#v4_0_1#openvdb##QAE?AV?$shared_ptr#VGridBase#v4_0_1#openvdb###std##ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##6##Z) referenced in function "public: int __thiscall OpenVDB_c::readGrid(int,char *)" (?readGrid#OpenVDB_c##QAEHHPAD#Z)
Error LNK2001 unresolved external symbol "public: virtual class std::shared_ptr<class openvdb::v4_0_1::io::Archive> __thiscall openvdb::v4_0_1::io::File::copy(void)const " (?copy#File#io#v4_0_1#openvdb##UBE?AV?$shared_ptr#VArchive#io#v4_0_1#openvdb###std##XZ)
Error LNK2001 unresolved external symbol "public: virtual void __thiscall openvdb::v4_0_1::io::File::write(class std::vector<class std::shared_ptr<class openvdb::v4_0_1::GridBase const >,class std::allocator<class std::shared_ptr<class openvdb::v4_0_1::GridBase const > > > const &,class openvdb::v4_0_1::MetaMap const &)const " (?write#File#io#v4_0_1#openvdb##UBEXABV?$vector#V?$shared_ptr#$$CBVGridBase#v4_0_1#openvdb###std##V?$allocator#V?$shared_ptr#$$CBVGridBase#v4_0_1#openvdb###std###2##std##ABVMetaMap#34##Z)
Error LNK2001 unresolved external symbol "__declspec(dllimport) private: static union half::uif const * const half::_toFloat" (__imp_?_toFloat#half##0QBTuif#1#B) C:\Users\t00001657\documents\visual studio 2015\Projects\OVDBC\OVDBC\ovdbc.obj 1
OpenVDB and all of its dependencies are in the include folder, whose directory is added to additional include directories, and this is my current list of Additional Dependencies under the Linker options:
blosc.lib
cppunit.lib
glew32.lib
glfw3.lib
Half.lib
Iex-2_2.lib
IexMath-2_2.lib
IlmImf-2_2.lib
IlmImfUtil-2_2.lib
IlmThread-2_2.lib
Imath2_2.lib
openvdb.lib
tbb.lib
tbb_debug.lib
tbb_preview.lib
tbb_preview_debug.lib
tbbmalloc.lib
tbbmalloc_debug.lib
tbbproxy.lib
zlibstaticd.lib
I can't seem to find any information on compiling with OpenVDB in Visual Studio that covers this kind of error, and am pretty stumped as to what I could be forgetting.
It turned out to be a combination of a couple problems:
My OpenVDB binaries were compiled with OPENVDB_3_ABI_COMPATIBLE defined, and so were using the boost version of shared_ptr instead of the std version, but I hadn't defined OPENVDB_3_ABI_COMPATIBLE when trying to build my project, so it was trying to build using the std version; hence, undefined externals.
I hadn't defined OPENEXR_DLL and HALF_EXPORTS, which is evidently required when building with those libraries, unbeknownst to me.
I was compiling with the /MT option instead of the /MDd option used by half.lib
In the end, all I needed to do was define OPENEXR_DLL, HALF_EXPORTS, and OPENVDB_3_ABI_COMPATIBLE, and switch the build option to /MDd.
Try to use Vcpkg.
It supports visual studio 2015,2017
https://github.com/Microsoft/vcpkg
It's easy to use like yum in Linux.

Problems with linking CEF3

I'm having some problems with using CEF in my application which uses the MD/MDd runtime library linking.
I have downloaded the latest build of CEF3 from cefbuilds.com and followed the instructions How to link CEF against a different run-time library.
I have built the "libcef_dll_wrapper" project after changing "Runtime Library" to "/MDd" and "Platform Toolset" to "v110" and then I've linked the resulting "libcef_dll_wrapper.lib" binary to my project.
However, when I try to build my project I get the following errors:
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol _cef_string_utf16_clear referenced in function "public: static void __cdecl CefBrowserSettingsTraits::clear(struct _cef_browser_settings_t *)" (?clear#CefBrowserSettingsTraits##SAXPAU_cef_browser_settings_t###Z)
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol _cef_string_utf8_to_utf16 referenced in function "public: static bool __cdecl CefStringTraitsUTF16::from_string(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct _cef_string_utf16_t *)" (?from_string#CefStringTraitsUTF16##SA_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAU_cef_string_utf16_t###Z)
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol _cef_string_list_free referenced in function "public: static void __cdecl CefSettingsTraits::clear(struct _cef_settings_t *)" (?clear#CefSettingsTraits##SAXPAU_cef_settings_t###Z)
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol "public: static bool __cdecl CefBrowser::CreateBrowser(class CefWindowInfo &,class CefRefPtr<class CefClient>,class CefStringBase<struct CefStringTraitsUTF16> const &,class CefStructBase<struct CefBrowserSettingsTraits> const &)" (?CreateBrowser#CefBrowser##SA_NAAVCefWindowInfo##V?$CefRefPtr#VCefClient####ABV?$CefStringBase#UCefStringTraitsUTF16####ABV?$CefStructBase#UCefBrowserSettingsTraits#####Z) referenced in function "public: void __thiscall caspar::html::html_producer::run(void)" (?run#html_producer#html#caspar##QAEXXZ)
12>html.lib(html_producer.obj) : error LNK2019: unresolved external symbol "bool __cdecl CefInitialize(class CefStructBase<struct CefSettingsTraits> const &,class CefRefPtr<class CefApp>)" (?CefInitialize##YA_NABV?$CefStructBase#UCefSettingsTraits####V?$CefRefPtr#VCefApp#####Z) referenced in function "public: void __thiscall caspar::html::html_producer::run(void)" (?run#html_producer#html#caspar##QAEXXZ)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_execute_process referenced in function "int __cdecl CefExecuteProcess(class CefMainArgs const &,class CefRefPtr<class CefApp>)" (?CefExecuteProcess##YAHABVCefMainArgs##V?$CefRefPtr#VCefApp#####Z)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_initialize referenced in function "bool __cdecl CefInitialize(class CefMainArgs const &,class CefStructBase<struct CefSettingsTraits> const &,class CefRefPtr<class CefApp>)" (?CefInitialize##YA_NABVCefMainArgs##ABV?$CefStructBase#UCefSettingsTraits####V?$CefRefPtr#VCefApp#####Z)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_shutdown referenced in function "void __cdecl CefShutdown(void)" (?CefShutdown##YAXXZ)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_do_message_loop_work referenced in function "void __cdecl CefDoMessageLoopWork(void)" (?CefDoMessageLoopWork##YAXXZ)
12>libcef_dll_wrapper.lib(libcef_dll_wrapper.obj) : error LNK2019: unresolved external symbol __imp__cef_run_message_loop referenced in function "void __cdecl CefRunMessageLoop(void)" (?CefRunMessageLoop##YAXXZ)
The full log can be found here.
Any ideas as to what I might be missing?
Are you also libcef.lib in the linker input?

what is the meaning of these linker errors?

I wish I could ask "What libraries do i need to link" but it's quite specific (wwise engine integration), so I need help in working it out myself. The problem occurs when I attempt to create a variable of a type defined in a header file (compiler finds the header no problem). I get 22 linker errors but I don't understand the read out, could someone walk me through it and tell me precisely which symbol is missing so I can figure out what libraries I'm missing? and could it be anything other than a library not linking? Wwise comes with a demo project that compiles but doesnt link to any more libraries than I do.
Here are 5 of the errors. I'm using visual studio.
1>main.obj : error LNK2019: unresolved external symbol "public: enum AKRESULT __thiscall CAkDefaultIOHookBlocking::Init(struct AkDeviceSettings const &,bool)" (?Init#CAkDefaultIOHookBlocking##QAE?AW4AKRESULT##ABUAkDeviceSettings##_N#Z) referenced in function "bool __cdecl InitSoundEngine(void)" (?InitSoundEngine##YA_NXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CAkDefaultIOHookBlocking::GetDeviceDesc(struct AkDeviceDesc &)" (?GetDeviceDesc#CAkDefaultIOHookBlocking##UAEXAAUAkDeviceDesc###Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __thiscall CAkDefaultIOHookBlocking::GetDeviceData(void)" (?GetDeviceData#CAkDefaultIOHookBlocking##UAEKXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual enum AKRESULT __thiscall CAkDefaultIOHookBlocking::Read(struct AkFileDesc &,struct AkIoHeuristics const &,void *,struct AkIOTransferInfo &)" (?Read#CAkDefaultIOHookBlocking##UAE?AW4AKRESULT##AAUAkFileDesc##ABUAkIoHeuristics##PAXAAUAkIOTransferInfo###Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual enum AKRESULT __thiscall CAkDefaultIOHookBlocking::Write(struct AkFileDesc &,struct AkIoHeuristics const &,void *,struct AkIOTransferInfo &)" (?Write#CAkDefaultIOHookBlocking##UAE?AW4AKRESULT##AAUAkFileDesc##ABUAkIoHeuristics##PAXAAUAkIOTransferInfo###Z)
The symbols are:
enum AKRESULT CAkDefaultIOHookBlocking::Init(struct AkDeviceSettings const &,bool)
virtual void CAkDefaultIOHookBlocking::GetDeviceDesc(struct AkDeviceDesc &)
virtual unsigned long CAkDefaultIOHookBlocking::GetDeviceData(void)
virtual enum AKRESULT CAkDefaultIOHookBlocking::Read(struct AkFileDesc &,struct AkIoHeuristics const &,void *,struct AkIOTransferInfo &)
virtual enum AKRESULT CAkDefaultIOHookBlocking::Write(struct AkFileDesc &,struct AkIoHeuristics const &,void *,struct AkIOTransferInfo &)
As far as I can tell, you only have the header that declares the class CAkDefaultIOHookBlocking, which means that you attempt to use any of the above symbols you'll need to link against the library.
Wwise comes with a demo project that compiles but doesnt link to any more libraries than I do.
Either the symbols aren't used, or the source files that defines those symbols is compiled in that project - http://gmwwise.googlecode.com/svn-history/r2/trunk/GMWwise/wwise/AkDefaultIOHookBlocking.cpp
You have a file AkDefaultIOHookBlocking.cpp that hasn't been added to the project you're building.