I’m trying to use the OpenAL library and I get the following error message when I call “ALFWInit();”
unresolved external symbol “void
__cdecl ALFWInit(void)” (?ALFWInit@@YAXXZ) referenced in
function “public: __cdecl
MyTestClass::MyTestClass(void)”
(??0MyTestClass@@QEAA@XZ)
In my game.build.cs file I have the following and it compiles without error. The OpenAL Lib is in a new folder called "ThirdParty in the project’s root:
MyGame.Build.cs
//Include OpenAL Library
string ModulePath = Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name));
string ThirdPartyPath = Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/"));
PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "OpenAL\\libs\\Win64\\OpenAL32.lib"));
PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "OpenAL\\include"));
PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "OpenAL\\framework\\Win32"));
My Header
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
class CLEANTHIRDPERSON_API MyTestClass
{
public:
MyTestClass();
~MyTestClass();
};
My TestClass.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "CleanThirdPerson.h"
#include "MyTestClass.h"
#include "AllowWindowsPlatformTypes.h"
#include "Framework.h"
#include "HideWindowsPlatformTypes.h"
MyTestClass::MyTestClass()
{
// Initialize Framework
ALFWInit(); //IF I COMMENT OUT THIS METHOD, EVERYTHING COMPILES A-OK
// Close down OpenAL
//ALFWShutdownOpenAL();
// Close down the Framework
//ALFWShutdown();
}
MyTestClass::~MyTestClass()
{
}
Does anyone have an idea what I’m doing wrong?