Skip to content

multiple definition of `main' if using precompiled googletest library (no cmake) #7

@anb0s

Description

@anb0s

I'm facing linker error when using with already created googletest library:

Linking D:\git\s7p\work3\s7p.base/bin/unittest/vdk_signals_tests/vdk_signals_tests.o...
d:/git/s7p/work3/s7p.tools/win64_gcc_mingw64_9.2.0/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\git\s7p\work3\s7p.base\obj\unittest\base\user\googletest.o: in function `main':
D:/git/s7p/work3/s7p.base/google/test-master/googlemock/src/gmock_main.cc:56: multiple definition of `main'; D:\git\s7p\work3\s7p.base\obj\unittest\user\vdk_signals_tests.o:D:/git/s7p/work3/s7p.base/vdk/signals-master/tests/tests.cpp:948: first defined here
collect2.exe: error: ld returned 1 exit status

I'm not using cmake and therefore the problem belongs to my environment with prcompiled googletest library with main. May be an #if defined(VDK_SIGNALS_USE_OWN_MAIN) can be used to configure this from users perspective? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions