meekrosoft / fff

A testing micro framework for creating function test doubles
Other
749 stars 163 forks source link

MVSC linking error multiple modules - How do I reuse a fake across multiple test-suites? #96

Open CallistorrB opened 3 years ago

CallistorrB commented 3 years ago

Hi,

Is there any solution for using multiple modules across multiple test-suites for MVSC? I'm getting linking error with MVSC linker, with clang I use ((weak)). Is there any equivalent for ((weak)) while linking with MVSC linker? I'm using Clang 7.0 and MVSC 14.16 linker(link.exe).

fake.h DECLARE_FAKE_VALUE_FUNC3(int, seek, int, long, int); fake.c DEFINE_FAKE_VALUE_FUNC3(int, seek, int, long, int);

error LNK2005: seek already defined in fake.lib(fake.c.1.o)

Thanks.

cakira commented 3 years ago

I don't use MSVC, but could this link be useful?

https://stackoverflow.com/a/11529277/1669975

tohsaka888 commented 7 months ago

MinGW has the same error