Unresolved External - OpenAL

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?

That’s a linker error and there are a large number of things that can cause that so its a bit hard to debug without seeing your setup.

Most likely you’re not successfully linking to the OpenAL lib but are correctly including the include paths. In this case I’m going to guess its something related to trying to link to a 32 bit lib in 64 bit. You need to make sure you’re trying to load a compatible library.

Check out: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

If you haven’t yet, you should check out tutorials on how to link to 3rd party DLLs.

It’s probably going be easier to do this with a dynamic library vs a static library, and probably even better to do it as a plugin if you can.

I can confirm it’s a 64bit lib. It just has 32 in the name, don’t ask me why. I’ve gone through all of those links. Spent countless hours on this issue and moved on.