You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used oatpp starter project to check compatibility in windows for two different compilers.
using MSVC compiler, starter project compiled and linking is success and application ran successfully.
using msys64/mingw64 gcc compiler, facing below linker issues.
Can somebody help me what I need to do to fix this linker issue. Since it is clearly working with MSVC compiler i am not able to find out what is going wrong while using gcc compiler.
`PS C:\Users\Downloads\oatpp-starter-master\oatpp-starter-master\build> cmake -DCMAKE_C_COMPILER="C:/msys64/mingw64/bin/gcc.exe" -DCMAKE_CXX_COMPILER="C:/msys64/mingw64/bin/g++.exe" -G "MinGW Makefiles" --fresh ..
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (5.1s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/Downloads/oatpp-starter-master/oatpp-starter-master/build
I used oatpp starter project to check compatibility in windows for two different compilers.
Can somebody help me what I need to do to fix this linker issue. Since it is clearly working with MSVC compiler i am not able to find out what is going wrong while using gcc compiler.
`PS C:\Users\Downloads\oatpp-starter-master\oatpp-starter-master\build> cmake -DCMAKE_C_COMPILER="C:/msys64/mingw64/bin/gcc.exe" -DCMAKE_CXX_COMPILER="C:/msys64/mingw64/bin/g++.exe" -G "MinGW Makefiles" --fresh ..
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (5.1s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/Downloads/oatpp-starter-master/oatpp-starter-master/build
PS C:\Users\Downloads\oatpp-starter-master\oatpp-starter-master\build> cmake --build .
[ 14%] Building CXX object CMakeFiles/my-project-lib.dir/src/controller/MyController.cpp.obj
[ 28%] Linking CXX static library libmy-project-lib.a
[ 28%] Built target my-project-lib
[ 42%] Building CXX object CMakeFiles/my-project-exe.dir/src/App.cpp.obj
[ 57%] Linking CXX executable my-project-exe.exe
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\my-project-exe.dir/objects.a(App.cpp.obj):App.cpp:(.text+0xc8): **undefined reference to
oatpp::base::Environment::getComponent**(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\my-project-exe.dir/objects.a(App.cpp.obj):App.cpp:(.text+0x141): undefined reference to
oatpp::web::server::HttpRouter::addController(std::shared_ptroatpp::web::server::api::ApiController const&)'C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\my-project-exe.dir/objects.a(App.cpp.obj):App.cpp:(.text+0x1b8): undefined reference to
oatpp::base::Environment::getComponent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\my-project-exe.dir/objects.a(App.cpp.obj):App.cpp:(.text+0x228): undefined reference to
oatpp::base::Environment::getComponent(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'`The text was updated successfully, but these errors were encountered: