Inline keyword causes unresolved external during Launch

Public class functions with the inline keyword cause an unresolved external error during launch build. Removing the inline keywords prevents the launch errors. Compiling and running in the editor works without problems.

Is there some way to use inline without the errors?

The engine version is 4.7.6

The error log:

LogPlayLevel: UnrealBuildTool:    Creating library C:\SVN\Projects\Graduation\TerraVox\Binaries\Win64\TerraVox.lib and object C:\SVN\Projects\Graduation\TerraVox\Binaries\Win64\TerraVox.exp
LogPlayLevel: UnrealBuildTool: MCMeshExtractor.cpp.obj : error LNK2001: unresolved external symbol "public: struct TerraVox::Voxel const & __cdecl TerraVox::VolumeBlock::GetVoxel(struct FIntVector const &,struct FIntVector const &)const " (?GetVoxel@VolumeBlock@TerraVox@@QEBAAEBUVoxel@2@AEBUFIntVector@@0@Z)
LogPlayLevel: UnrealBuildTool: MCMeshExtractor.cpp.obj : error LNK2001: unresolved external symbol "public: struct FIntVector __cdecl TerraVox::VolumeTree::GetBlockSize(void)const " (?GetBlockSize@VolumeTree@TerraVox@@QEBA?AUFIntVector@@XZ)
LogPlayLevel: UnrealBuildTool: MCMeshExtractor.cpp.obj : error LNK2001: unresolved external symbol "public: struct FIntVector __cdecl TerraVox::VolumeTree::GetBlockSizePower(void)const " (?GetBlockSizePower@VolumeTree@TerraVox@@QEBA?AUFIntVector@@XZ)
LogPlayLevel: UnrealBuildTool: MCMeshExtractor.cpp.obj : error LNK2001: unresolved external symbol "public: unsigned int __cdecl TerraVox::VolumeTree::GetCellSize(void)const " (?GetCellSize@VolumeTree@TerraVox@@QEBAIXZ)
LogPlayLevel: UnrealBuildTool: MCMeshExtractor.cpp.obj : error LNK2001: unresolved external symbol "public: class std::shared_ptr<class TerraVox::VolumeBlock const > const __cdecl TerraVox::VolumeTree::GetBlock(struct FIntVector const &)" (?GetBlock@VolumeTree@TerraVox@@QEAA?BV?$shared_ptr@$$CBVVolumeBlock@TerraVox@@@std@@AEBUFIntVector@@@Z)
LogPlayLevel: UnrealBuildTool: TerraVoxManager.cpp.obj : error LNK2001: unresolved external symbol "public: class std::shared_ptr<class TerraVox::VolumeBlock const > const __cdecl TerraVox::VolumeTree::GetBlock(struct FIntVector const &)" (?GetBlock@VolumeTree@TerraVox@@QEAA?BV?$shared_ptr@$$CBVVolumeBlock@TerraVox@@@std@@AEBUFIntVector@@@Z)
LogPlayLevel: UnrealBuildTool: TerraVoxManager.cpp.obj : error LNK2001: unresolved external symbol "public: bool __cdecl TerraVox::VolumeBlock::IsEmpty(void)const " (?IsEmpty@VolumeBlock@TerraVox@@QEBA_NXZ)
LogPlayLevel: UnrealBuildTool: TerraVoxManager.cpp.obj : error LNK2001: unresolved external symbol "public: struct FVector __cdecl TerraVox::V

Hello, Meessen

Please note that linker errors may occur in the situation when inline function is defined in one .cpp file and then called from another .cpp file.

Thus, please make sure that your function is defined in the header file.

Hope this helped!

Have a great day!

Thank you that is it :slight_smile: I thought that declaring the function in the header would work, but apparently that is not good enough for inline.