dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

'FDELT_TYPE 'does not name a type #2913

Closed hzxGoForward closed 4 years ago

hzxGoForward commented 5 years ago

'FDELT_TYPE 'does not name a type

  1. Building the projet in my own desktop(x86_64-pc-linux)
  2. add '-DHAVE_CONFIG=1' in to "add_definitions" in CMakeLists.txt
  3. add some extra directories in 'include_directories' in CMakeLists.txt.
  4. all the file I have moidified is just CMakeLists.txt

Here is my CMakeLists.txt:

# This CMakeLists.txt is not meant to actually work!
# It only serves as a dummy project to make CLion work properly when it comes to symbol resolution and all the nice
# features dependent on that. Building must still be done on the command line using the automake build chain
# If you load this project in CLion and would like to run/debug executables, make sure to remove the "Build" entry from
# the run/debug configuration as otherwise CLion will try to build this project with cmake, failing horribly.
# You'll also have to manually change the executable in the configuration to the correct path of the already built executable

cmake_minimum_required(VERSION 3.7)
project(dash)

set(CMAKE_CXX_STANDARD 14)

include_directories(
        /usr/include/x86_64-linux-gnu
        # /usr/include/
        src
        src/qt/forms
        src/leveldb/include
        src/univalue/include
        src/config
        src/depends/x86_64-pc-linux-gnu/include
        src/leveldb/helpers/memenv
        ${CMAKE_CURRENT_SOURCE_DIR}/src/qt
        ${CMAKE_CURRENT_SOURCE_DIR}/src/univalue/include
        ${CMAKE_CURRENT_SOURCE_DIR}/src/secp256k1/include
        ${CMAKE_CURRENT_SOURCE_DIR}/src/qt/forms
        ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb
        ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/db
        ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/config
        ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/port
        ${CMAKE_CURRENT_SOURCE_DIR}/src/leveldb/util
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtCore
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtGui
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtDBus
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtNetwork

        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtWidgets
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtPlatformHeaders

        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtPrintSupport
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtTest
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/QtXml
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/Xll
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/xcb-shared/scb
        ${CMAKE_CURRENT_SOURCE_DIR}/depends/x86_64-pc-linux-gnu/include/boost
)

if(UNIX AND NOT APPLE)
    set(DEPENDS_PREFIX depends/x86_64-pc-linux-gnu)
elseif(APPLE)
    set(DEPENDS_PREFIX depends/x86_64-apple-darwin11)
elseif(WIN32)
    set(DEPENDS_PREFIX depends/x86_64-w64-mingw32)
endif()

message(STATUS "DEPENDS_PREFIX: ${DEPENDS_PREFIX}")

if(DEFINED DEPENDS_PREFIX)
    include_directories(${DEPENDS_PREFIX}/include)
    include_directories(${DEPENDS_PREFIX}/include/QtWidgets)
endif()

add_definitions(
        -DENABLE_WALLET=1
        -DHAVE_CONFIG_H=1
        -DHAVE_SYS_SELECT_H=1
)

file(GLOB SOURCE_FILES
        src/bench/*.cpp
        src/bench/*.h
        src/bls/*.cpp
        src/bls/*.h
        src/compat/*.cpp
        src/compat/*.h
        src/consensus/*.h
        src/consensus/*.cpp
        src/crypto/*.c
        src/crypto/*.h
        src/crypto/*.cpp
        src/leveldb/db/*.cc
        src/leveldb/db/*.h
        src/leveldb/include/*.h
        src/policy/*.cpp
        src/policy/*.h
        src/primitives/*.cpp
        src/primitives/*.h
        src/qt/test/*.cpp
        src/qt/test/*.h
        src/qt/*.cpp
        src/qt/*.h
        src/script/*.cpp
        src/script/*.h
        src/secp256k1/include/*.h
        src/test/*.cpp
        src/test/*.h
        src/univalue/include/*.h
        src/univalue/lib/*.cpp
        src/univalue/lib/*.h
        src/wallet/test/*.cpp
        src/wallet/*.cpp
        src/wallet/*.h
        src/zmq/*.cpp
        src/zmq/*.h
        src/*.cpp
        src/*.h
        src/evo/*.h
        src/evo/*.cpp
        src/llmq/*.h
        src/llmq/*.cpp
        src/rpc/*.cpp
        src/rpc/*.h
         # src/dashd.cpp
        )

 add_executable(dash ${SOURCE_FILES})

When I clicked the 'Build' button in CLion, I got a wong message which is :

/usr/gitHubCode/dash/src/compat/glibc_compat.cpp:24:12: error: ‘FDELT_TYPE’ does not name a type; did you mean ‘DEV_T_TYPE’? extern "C" FDELT_TYPE fdelt_warn(FDELT_TYPE a) ^~~~~~ DEV_T_TYPE /usr/gitHubCode/dash/src/compat/glibc_compat.cpp:30:12: error: ‘FDELT_TYPE’ does not name a type; did you mean ‘__DEV_T_TYPE’? extern "C" FDELT_TYPE fdelt_chk(FDELT_TYPE) attribute((weak, alias("__fdelt_warn"))); ^~~~~~

So, can anyone know tells me how to fix this problem or How can I build it successifully in CLion? Thanks.

10xcryptodev commented 4 years ago

@hzxGoForward you will need to configure a custom build, following these steps:

  1. build dependencies and ./configure following the steps https://github.com/dashpay/dash/blob/master/doc/build-generic.md if you want debug ./configure --enable-debug
  2. generate the executables for your OS:
  3. import/open the dash folder on CLion
  4. configure a custom build target - https://www.jetbrains.com/help/clion/custom-build-targets.html# named as dash make the target in my example
  5. Run -> Edit Configurations...
  6. Add a Custom Build Application: Screenshot from 2020-05-17 16-18-01 Target: choose the target defined in step 4 Executable: could be dash-qt or dashd - generated in step 2 Program arguments: parameters that will be passed when starting the executable

Now you can run or debug the code Have fun :)