runtime error with Eigen lib in UE

Hello, i have a question about modules. I am trying to create a custom module with cpp files and header files. Then I want to link it to my "CNC "primary game module and use the functions in "Test"custom module at begin play event of my “Machine” actor of “CNC” module. When I compile, I get an error message as below;

ld.lld: error: undefined symbol: summation(int, int)
>>> referenced by Machine.cpp:129 (/home/enes/Documents/Unreal Projects/CNC/Source/CNC/Machine.cpp:129)
>>>               /home/enes/Documents/Unreal Projects/CNC/Intermediate/Build/Linux/B4D820EA/UnrealEditor/Development/CNC/Machine.cpp.o:(AMachine::BeginPlay())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

I created below “Test Module” files

Source/Test/Test.Build.cs:

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class Test : ModuleRules
{
	public Test(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "EnhancedInput"});

	}
}

Source/Test/Test.h:

// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"

Source/Test/Test.cpp:

// Copyright Epic Games, Inc. All Rights Reserved.

#include "Test.h"
#include "Modules/ModuleManager.h"

IMPLEMENT_MODULE(FDefaultModuleImpl, Test);
 

Source/Test/Foo.h:

int summation(int a, int b);

Source/Test/Foo.cpp:

#include "Foo.h"

int summation(int a, int b)
{
    return a + b;
}

I edited the “CNC” primary game module to utilize the function in Foo.h as below

Source/CNC/CNC.Build.cs

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class CNC : ModuleRules
{
	public CNC(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "EnhancedInput", "Test"});
		PublicIncludePaths.AddRange(new string[] {"Test"});
	}
}

Finally I included the Foo.h in my actor “Machine.cpp” that belongs to “CNC” primary module and added a summation function.
The compilation fails. Can you help me solving this please?

I think you must include the library(.lib/.obj file) in visual studio.
See Linker Property Pages | Microsoft Learn

Thanks for your reply. How can I do it with vscode on Linux?
I haven’t got a static lib generated in Intermediate folder in order to link it to my main game module.

Im sorry, but my last answer was kind of wrong.
EDIT: For static libraries:
The lib must be included in the YourProject.Build.cs, not in visual studio.
You can add line like this:

PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "ThirdParty", "YourLib.lib"));

This assumes the .lib is in the ThirdParty directory.
Unreal Documentation is under:

EDIT: Im still wrong as you said you dont have a static library.