cmake for MinGW and STC link errors

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
AndrzejB
Experienced Solver
Experienced Solver
Posts: 88
Joined: Sun Nov 29, 2015 12:46 pm

cmake for MinGW and STC link errors

Post by AndrzejB » Sat May 29, 2021 7:40 am

I build

Code: Select all

c:\wxWidgets-3.1.5\build\msw>mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release
next

Code: Select all

c:\gitmy\scintas\src\build>cmake -G "MinGW Makefiles" ..
My modified part of CMakeLists.txt :

Code: Select all

    set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/lib/gcc_lib)
    if(CMAKE_BUILD_TYPE STREQUAL "Debug")
        set(wxWidgets_CONFIGURATION gcc_mswud)
    endif()
    if(CMAKE_BUILD_TYPE STREQUAL "Release")
        set(wxWidgets_CONFIGURATION gcc_mswu)
    endif()
I get STC errors, for exmaple

Code: Select all

C:/wxWidgets-3.1.5/lib/gcc_lib/libwxmsw31u_stc.a(stclib_ScintillaWX.o):ScintillaWX.cpp:(.rdata$_ZTV11ScintillaWX[__ZTV11ScintillaWX]+0xe4): undefined reference to `Editor::TickFor(Editor::TickReason)'
C:/wxWidgets-3.1.5/lib/gcc_lib/libwxmsw31u_stc.a(stclib_ScintillaWX.o):ScintillaWX.cpp:(.rdata$_ZTV11ScintillaWX[__ZTV11ScintillaWX]+0x104): undefined reference to `Editor::IdleWork()'

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5224
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: cmake for MinGW and STC link errors

Post by ONEEYEMAN » Sat May 29, 2021 12:34 pm

Hi,
Are you using MinGW or MSVC?

Thank you.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 3062
Joined: Sun Jan 03, 2010 5:45 pm

Re: cmake for MinGW and STC link errors

Post by PB » Sat May 29, 2021 2:45 pm

You must be doing something you did not mention here.

Your make arguments show that you build wxWidgets as DLLs (SHARED=1), which puts them in WXWIN/lib/gcc_dll folder. However, your CMakefile refers to gcc_lib folder.

If you use DLL wxWidgets build, your application does not need to link to scintilla library itself (libwxscintilla.a), however, in the static one it does.

Post Reply