radareorg / r2retdec

RetDec plugin for Radare2
https://retdec.com/
MIT License
124 stars 24 forks source link

Problem compiling on windows #28

Open zi0Black opened 3 years ago

zi0Black commented 3 years ago

CMakeFiles flags:

."C:\Program Files\CMake\bin\cmake.exe" .. -DCMAKE_INSTALL_PREFIX="C:\Users\zi0Black\AppData\Roaming\RadareOrg\Cutter\plugins\native" -DBUILD_BUNDLED_RETDEC=ON -DR2PLUGIN_DOC=OFF -DBUILD_CUTTER_PLUGIN=ON -DCMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64 -G"Visual Studio 16 2019" -A x64

CMakes output:

-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042.
-- The C compiler identification is MSVC 19.28.29334.0
-- The CXX compiler identification is MSVC 19.28.29334.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.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:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Found Radare2: Radare2::libr
-- Found PythonInterp: C:/Python39/python.exe (found suitable version "3.9", minimum required is "3.4")
-- Capstone: using remote Capstone revision.
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- LLVM: using remote LLVM revision.
-- YARA: using remote YARA revision.
-- YaraMod: using remote YaraMod revision.
-- Found OpenSSL: optimized;C:/Program Files/OpenSSL-Win64/lib/VC/static/libcrypto64MD.lib;debug;C:/Program Files/OpenSSL-Win64/lib/VC/static/libcrypto64MDd.lib (found suitable version "1.1.1h", minimum required is "1.0.1")
-- -- Library stdc++fs NOT FOUND -> linking utils without stdc++fs library
-- Found Cutter: C:/tmp/retdec-r2plugin/build/_deps/cutter-src/src
-- Library stdc++fs NOT FOUND -> linking core_retdec without stdc++fs library
-- Configuring done
-- Generating done
-- Build files have been written to: C:/tmp/retdec-r2plugin/build

Visual studio builds out-put:

43>Generating Code...
43>   Creating library C:/tmp/retdec-r2plugin/build/src/r2plugin/Release/core_retdec.lib and object C:/tmp/retdec-r2plugin/build/src/r2plugin/Release/core_retdec.exp
43>r2retdec.obj : error LNK2019: unresolved external symbol r_str_home referenced in function "class retdec::config::Config __cdecl retdec::r2plugin::createConfig(class retdec::r2plugin::R2Database const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?createConfig@r2plugin@retdec@@YA?AVConfig@config@2@AEBVR2Database@12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_list_free referenced in function "protected: void __cdecl retdec::r2plugin::R2Database::fetchExtraArgsData(class retdec::common::ObjectSequentialContainer &,struct r_anal_function_t &)const " (?fetchExtraArgsData@R2Database@r2plugin@retdec@@IEBAXAEAVObjectSequentialContainer@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_type_func_ret referenced in function "public: void __cdecl retdec::r2plugin::R2Database::fetchFunctionReturnType(class retdec::common::Function &,struct r_anal_function_t &)const " (?fetchFunctionReturnType@R2Database@r2plugin@retdec@@QEBAXAEAVFunction@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_type_func_args_count referenced in function "protected: void __cdecl retdec::r2plugin::R2Database::fetchExtraArgsData(class retdec::common::ObjectSequentialContainer &,struct r_anal_function_t &)const " (?fetchExtraArgsData@R2Database@r2plugin@retdec@@IEBAXAEAVObjectSequentialContainer@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_bin_cur_object referenced in function "protected: void __cdecl retdec::r2plugin::R2Database::fetchGlobals(class retdec::config::Config &)const " (?fetchGlobals@R2Database@r2plugin@retdec@@IEBAXAEAVConfig@config@3@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_flag_get_i referenced in function "protected: void __cdecl retdec::r2plugin::R2Database::fetchGlobals(class retdec::config::Config &)const " (?fetchGlobals@R2Database@r2plugin@retdec@@IEBAXAEAVConfig@config@3@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_create_function referenced in function "public: void __cdecl retdec::r2plugin::R2Database::setFunction(class retdec::common::Function const &)const " (?setFunction@R2Database@r2plugin@retdec@@QEBAXAEBVFunction@common@3@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_get_function_at referenced in function "public: void __cdecl retdec::r2plugin::R2Database::setFunction(class retdec::common::Function const &)const " (?setFunction@R2Database@r2plugin@retdec@@QEBAXAEBVFunction@common@3@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_function_rename referenced in function "public: void __cdecl retdec::r2plugin::R2Database::copyFunctionData(class retdec::common::Function const &,struct r_anal_function_t &)const " (?copyFunctionData@R2Database@r2plugin@retdec@@QEBAXAEBVFunction@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_function_min_addr referenced in function "protected: class retdec::common::Function __cdecl retdec::r2plugin::R2Database::convertFunctionObject(struct r_anal_function_t &)const " (?convertFunctionObject@R2Database@r2plugin@retdec@@IEBA?AVFunction@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_function_max_addr referenced in function "protected: class retdec::common::Function __cdecl retdec::r2plugin::R2Database::convertFunctionObject(struct r_anal_function_t &)const " (?convertFunctionObject@R2Database@r2plugin@retdec@@IEBA?AVFunction@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_get_fcn_in referenced in function "public: class retdec::common::Function __cdecl retdec::r2plugin::R2Database::fetchFunction(unsigned __int64)const " (?fetchFunction@R2Database@r2plugin@retdec@@QEBA?AVFunction@common@3@_K@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_fcn_add_bb referenced in function "public: void __cdecl retdec::r2plugin::R2Database::setFunction(class retdec::common::Function const &)const " (?setFunction@R2Database@r2plugin@retdec@@QEBAXAEBVFunction@common@3@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_str_to_fcn referenced in function "public: void __cdecl retdec::r2plugin::R2Database::copyFunctionData(class retdec::common::Function const &,struct r_anal_function_t &)const " (?copyFunctionData@R2Database@r2plugin@retdec@@QEBAXAEBVFunction@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_get_fcns referenced in function "public: void __cdecl retdec::r2plugin::R2Database::fetchFunctionsAndGlobals(class retdec::config::Config &)const " (?fetchFunctionsAndGlobals@R2Database@r2plugin@retdec@@QEBAXAEAVConfig@config@3@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_anal_var_all_list referenced in function "public: void __cdecl retdec::r2plugin::R2Database::fetchFunctionLocalsAndArgs(class retdec::common::Function &,struct r_anal_function_t &)const " (?fetchFunctionLocalsAndArgs@R2Database@r2plugin@retdec@@QEBAXAEAVFunction@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_config_get_i referenced in function "public: void __cdecl retdec::r2plugin::R2Database::fetchFunctionLocalsAndArgs(class retdec::common::Function &,struct r_anal_function_t &)const " (?fetchFunctionLocalsAndArgs@R2Database@r2plugin@retdec@@QEBAXAEAVFunction@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol r_core_get_func_args referenced in function "protected: void __cdecl retdec::r2plugin::R2Database::fetchExtraArgsData(class retdec::common::ObjectSequentialContainer &,struct r_anal_function_t &)const " (?fetchExtraArgsData@R2Database@r2plugin@retdec@@IEBAXAEAVObjectSequentialContainer@common@3@AEAUr_anal_function_t@@@Z)
43>r2data.obj : error LNK2019: unresolved external symbol resolve_fcn_name referenced in function "protected: void __cdecl retdec::r2plugin::R2Database::fetchExtraArgsData(class retdec::common::ObjectSequentialContainer &,struct r_anal_function_t &)const " (?fetchExtraArgsData@R2Database@r2plugin@retdec@@IEBAXAEAVObjectSequentialContainer@common@3@AEAUr_anal_function_t@@@Z)
43>r2cgen.obj : error LNK2019: unresolved external symbol r_annotated_code_new referenced in function "protected: struct r_annotated_code_t * __cdecl retdec::r2plugin::R2CGenerator::provideAnnotations(class rapidjson::GenericDocument<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator>,class rapidjson::CrtAllocator> const &)const " (?provideAnnotations@R2CGenerator@r2plugin@retdec@@IEBAPEAUr_annotated_code_t@@AEBV?$GenericDocument@U?$UTF8@D@rapidjson@@V?$MemoryPoolAllocator@VCrtAllocator@rapidjson@@@2@VCrtAllocator@2@@rapidjson@@@Z)
43>r2cgen.obj : error LNK2019: unresolved external symbol r_annotated_code_free referenced in function "protected: struct r_annotated_code_t * __cdecl retdec::r2plugin::R2CGenerator::provideAnnotations(class rapidjson::GenericDocument<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator>,class rapidjson::CrtAllocator> const &)const " (?provideAnnotations@R2CGenerator@r2plugin@retdec@@IEBAPEAUr_annotated_code_t@@AEBV?$GenericDocument@U?$UTF8@D@rapidjson@@V?$MemoryPoolAllocator@VCrtAllocator@rapidjson@@@2@VCrtAllocator@2@@rapidjson@@@Z)
43>r2cgen.obj : error LNK2019: unresolved external symbol r_annotated_code_add_annotation referenced in function "protected: struct r_annotated_code_t * __cdecl retdec::r2plugin::R2CGenerator::provideAnnotations(class rapidjson::GenericDocument<struct rapidjson::UTF8<char>,class rapidjson::MemoryPoolAllocator<class rapidjson::CrtAllocator>,class rapidjson::CrtAllocator> const &)const " (?provideAnnotations@R2CGenerator@r2plugin@retdec@@IEBAPEAUr_annotated_code_t@@AEBV?$GenericDocument@U?$UTF8@D@rapidjson@@V?$MemoryPoolAllocator@VCrtAllocator@rapidjson@@@2@VCrtAllocator@2@@rapidjson@@@Z)
43>console.obj : error LNK2019: unresolved external symbol r_cons_cmd_help referenced in function "public: bool __cdecl retdec::r2plugin::Console::printHelp(struct r_core_t const &)const " (?printHelp@Console@r2plugin@retdec@@QEBA_NAEBUr_core_t@@@Z)
43>decompiler.obj : error LNK2019: unresolved external symbol r_vector_free referenced in function "private: static bool __cdecl retdec::r2plugin::DecompilerConsole::decompileWithOffsetsCurrent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class retdec::r2plugin::R2Database const &)" (?decompileWithOffsetsCurrent@DecompilerConsole@r2plugin@retdec@@CA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVR2Database@23@@Z)
43>decompiler.obj : error LNK2019: unresolved external symbol r_annotated_code_line_offsets referenced in function "private: static bool __cdecl retdec::r2plugin::DecompilerConsole::decompileWithOffsetsCurrent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class retdec::r2plugin::R2Database const &)" (?decompileWithOffsetsCurrent@DecompilerConsole@r2plugin@retdec@@CA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVR2Database@23@@Z)
43>decompiler.obj : error LNK2019: unresolved external symbol r_core_annotated_code_print_json referenced in function "private: static bool __cdecl retdec::r2plugin::DecompilerConsole::decompileJsonCurrent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class retdec::r2plugin::R2Database const &)" (?decompileJsonCurrent@DecompilerConsole@r2plugin@retdec@@CA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVR2Database@23@@Z)
43>decompiler.obj : error LNK2019: unresolved external symbol r_core_annotated_code_print referenced in function "private: static bool __cdecl retdec::r2plugin::DecompilerConsole::decompileCurrent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class retdec::r2plugin::R2Database const &)" (?decompileCurrent@DecompilerConsole@r2plugin@retdec@@CA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVR2Database@23@@Z)
43>decompiler.obj : error LNK2019: unresolved external symbol r_core_annotated_code_print_comment_cmds referenced in function "private: static bool __cdecl retdec::r2plugin::DecompilerConsole::decompileCommentCurrent(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class retdec::r2plugin::R2Database const &)" (?decompileCommentCurrent@DecompilerConsole@r2plugin@retdec@@CA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVR2Database@23@@Z)
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_core.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_config.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_cons.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_io.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_util.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_flag.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_asm.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_debug.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_hash.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_bin.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_lang.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_anal.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_parse.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_bp.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_egg.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_reg.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_search.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_syscall.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_socket.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_fs.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_magic.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\Users\zi0Black\AppData\Local\Programs\radare2\lib\r_crypto.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
43>C:\tmp\retdec-r2plugin\build\src\r2plugin\Release\core_retdec.dll : fatal error LNK1120: 28 unresolved externals
43>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1010,5): error MSB6006: "link.exe" exited with code 1120.
43>Done building project "core_retdec.vcxproj" -- FAILED.
44>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
44>Building Custom Rule C:/tmp/retdec-r2plugin/CMakeLists.txt
========== Build: 43 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Has anyone ever had this problem? Am I getting the CMake flags wrong?

trufae commented 2 years ago

please try again