Reputation: 1
I am doing an assignment and am getting compile errors - we are using a vcpkg.json with manifest mode in clion.
====================[ Build | testing | Debug ]=================================
"C:\Program Files\JetBrains\CLion 2023.3.2\bin\cmake\win\x64\bin\cmake.exe" --build C:\Users\flame\Downloads\3251-code\assignment4-student\cmake-build-debug --target testing -j 18
[1/3] Building CXX object CMakeFiles/Core.dir/src/visitors/whale.cpp.obj
[2/3] Linking CXX static library libCore.a
[3/3] Linking CXX executable C:\Users\flame\Downloads\3251-code\assignment4-student\bin\testing.exe
FAILED: C:/Users/flame/Downloads/3251-code/assignment4-student/bin/testing.exe
cmd.exe /C "cd . && C:\PROGRA~1\JETBRA~1\CLION2~1.2\bin\mingw\bin\G__~1.EXE -Wall -Werror -Wextra -pedantic -pedantic-errors -g -g CMakeFiles/testing.dir/tests/commands/balance.cpp.obj CMakeFiles/testing.dir/tests/commands/debug.cpp.obj CMakeFiles/testing.dir/tests/commands/factory.cpp.obj CMakeFiles/testing.dir/tests/commands/help.cpp.obj CMakeFiles/testing.dir/tests/commands/ledger.cpp.obj CMakeFiles/testing.dir/tests/commands/quit.cpp.obj CMakeFiles/testing.dir/tests/commands/seal.cpp.obj CMakeFiles/testing.dir/tests/commands/user.cpp.obj CMakeFiles/testing.dir/tests/commands/tx.cpp.obj CMakeFiles/testing.dir/tests/commands/whale.cpp.obj CMakeFiles/testing.dir/tests/core/options.cpp.obj CMakeFiles/testing.dir/tests/core/worker.cpp.obj CMakeFiles/testing.dir/tests/db/database.cpp.obj CMakeFiles/testing.dir/tests/db/rec_iterator.cpp.obj CMakeFiles/testing.dir/tests/db/record.cpp.obj CMakeFiles/testing.dir/tests/db/user.cpp.obj CMakeFiles/testing.dir/tests/db/tx.cpp.obj CMakeFiles/testing.dir/tests/db/tx_iterator.cpp.obj CMakeFiles/testing.dir/tests/db/formats/json_file.cpp.obj CMakeFiles/testing.dir/tests/hashes/hash.cpp.obj CMakeFiles/testing.dir/tests/hashes/md2.cpp.obj CMakeFiles/testing.dir/tests/main.cpp.obj -o C:\Users\flame\Downloads\3251-code\assignment4-student\bin\testing.exe -Wl,--out-implib,libtesting.dll.a -Wl,--major-image-version,0,--minor-image-version,0 libCore.a vcpkg_installed/x64-mingw-static/debug/lib/libgtest.a vcpkg_installed/x64-mingw-static/debug/lib/libbotan-3.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cmd.exe /C "cd /D C:\Users\flame\Downloads\3251-code\assignment4-student\cmake-build-debug && C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy Bypass -file C:/Users/flame/.vcpkg-clion/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/Users/flame/Downloads/3251-code/assignment4-student/bin/testing.exe -installedDir C:/Users/flame/Downloads/3251-code/assignment4-student/cmake-build-debug/vcpkg_installed/x64-mingw-static/debug/bin -OutVariable out""
C:\Program Files\JetBrains\CLion 2023.3.2\bin\mingw\bin/ld.exe: vcpkg_installed/x64-mingw-static/debug/lib/libbotan-3.a(utils_data_src.o): in function `Botan::DataSource_Stream::check_available(unsigned long long)':
C:/Users/flame/.vcpkg-clion/vcpkg/buildtrees/botan/src/3.1.1-d5e04c5040.clean/src/lib/utils/data_src.cpp:115: undefined reference to `std::istream::seekg(std::fpos<_Mbstatet>)'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
We are given the following build file
cmake_minimum_required(VERSION 3.24)
project(assignment4)
# Set compiler flags
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -pedantic -pedantic-errors -g")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -pedantic -pedantic-errors -fsanitize=address -g")
# Define all testing related content here
enable_testing()
include(FetchContent)
# Bring in Botan v3 library
find_library(BOTAN NAMES botan botan-3 REQUIRED)
find_package(GTest CONFIG REQUIRED)
## For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
find_package(nlohmann_json CONFIG REQUIRED)
set(nlohmann-json_IMPLICIT_CONVERSIONS OFF)
# Add of the lib header files
include_directories(${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include)
# Include project headers
include_directories(./include)
# Create library for core classes
add_library(Core STATIC)
add_subdirectory(./src/commands)
add_subdirectory(./src/core)
add_subdirectory(./src/db)
add_subdirectory(./src/hashes)
add_subdirectory(./src/visitors)
# Make the project root directory the working directory when we run
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
# Create CI testing application
add_executable(testing)
add_subdirectory(./tests)
add_dependencies(testing Core)
target_link_libraries(testing PRIVATE Core nlohmann_json::nlohmann_json GTest::gtest ${BOTAN})
# Create executable application
set(BASE_FILES src/main.cpp
include/visitors/whale.h)
add_executable(coin ${BASE_FILES})
add_dependencies(coin Core)
target_link_libraries(coin PRIVATE Core nlohmann_json::nlohmann_json ${BOTAN})
I'm not allowed to change the build file or vcpkg.json - this should be working, so I'm told there is an issue on my end.
It seems that botan specifically is not compiling correctly, but I'm not sure what to do with that. I haven't used any botan commands, and the file is within botan libraries. Are there environment variables or path variables I am missing? Others are able to complete the project fine?
Upvotes: 0
Views: 82