rest api – Cannot DIsplay a Snackbar Notice on Button Click – Notice is undefined

I am trying to use withSelect and withDispatch to display an admin notice when “save” button is clicked. I am using the following code from this repo but it throws an error: “notices is undefined”. Here is the code I am using:

import { Icon, Button, SnackbarList } from '@wordpress/components';
import { dispatch, withSelect, withDispatch } from '@wordpress/data';
import { compose } from '@wordpress/compose';
// Display and Dispatch the notice
const NewNotices = ({ notices, removeNotice }) => {
    
    //Uncaught TypeError: notices is undefined
    const snackbarNotices = notices.filter((notice) => notice.type === 'snackbar');

    return (
        <>
            <SnackbarList
                className="cwg-admin-notices"
                notices={snackbarNotices}
                onRemove={removeNotice}
            />
        </>
    );
}

export default compose((
    withSelect((select) => ({
        notices: select('core/notices').getNotices(),
    })),
    withDispatch((dispatch) => ({
        removeNotice: dispatch('core/notices').removeNotice,
    })),
))(NewNotices);
<>
//Create the notice on btn click
<Button
   isPrimary
   onClick={() =>
   {
   settings.save();
   dispatch('core/notices')
   .createNotice(
   'success',
   __('Settings Saved', 'slug'),
   {
   type: 'snackbar',
   isDismissible: true,
   icon: 
   <Icon icon="smiley" />
   }
   );
   }}
   >
   {__('Save', 'slug')}
</Button>
<NewNotices />
</>

javascript – Cannot read property ‘nome’ of undefined

Boa noite, sou novo em JavaScript e estou tentando construir uma API com os métodos básicos(CRUD).

Utilizando express e mongoose.

Estou tendo o seguinte problema no qual não consigo resolver:

inserir a descrição da imagem aqui

Localizei o erro com a foto na parte de rotas, linha 14 col 24, não conseguindo acessar a propriedade nome do objeto do meu schema.

Não sei o que fazer, pois modelei deste jeito em um outro exercício e desta vez não está indo :/

Configuração do meu servidor:

const mongoose = require('mongoose')
const cors = require('cors')
const express = require('express')
const rotas = require('./routes/routes.js')
require('./db/mongoose')

const app = express()

app.use(rotas)
app.use(cors())
app.use(express.urlencoded({extended:true}))
app.use(express.json())

const porta = 3080 | process.env.PORT
app.listen(porta)

Minha dataBase

const mongoose = require('mongoose')

mongoose.connect('mongodb://localhost:27017/cadastro',{ useUnifiedTopology:true ,useNewUrlParser: true })
.then(()=>{
    console.log('Conectado ao Banco')
}).catch(error=>{
    console.log('Não foi possível conectar ao Banco' + error)
})

module.exports = mongoose.connection

Modelagem dos dados

const mongoose = require('mongoose')
const Modelagem = mongoose.Schema //Modelando meus dados

const dadosModelados = new Modelagem({
    nome: String,
    preco: Number,
})

module.exports =  mongoose.model('Produtos', dadosModelados)

Minhas rotas

const express = require('express')
const Produtos = require('../models/model.js')
const router = express.Router()

router.get('/', (req,res)=>{
    Produtos.find({},(erro,produtos)=>{
        res.json(produtos)
    })
})
router.post('/',(req,res)=>{
 novoProduto = new Produtos({
        name: req.body.nome, //propriedade nome como undefined
        preco: req.body.email
    })
    novoProduto.save(()=>{
        res.json(novoProduto)
    })
})
router.put('/:id', async (req,res)=>{
 let atualizarProduto = await Produto.findById(req.params.id)   
        atualizarProduto.nome = req.body.nome
        atualizarProduto.email = req.body.preco
        
        atualizarProduto.save(()=>{
            res.json(atualizarProduto)
        })
})
router.delete('/:id', (req,res)=>{
    produto.findByIdAndDelete(req.params.id)
})

module.exports = router

altcoin – After add some files , it shows undefined reference,how to solve it?

I am a newbie learning bitcoin source. I add a new POW function and add it to the source of bitcoin-0.20.But it shows below, I’m still thinking about it but get no solution indeed, would you please help me?

CXXLD    test/test_bitcoin
/usr/bin/ld: libbitcoin_common.a(libbitcoin_common_a-coins.o): in function `SaltedOutpointHasher::operator()(COutPoint const&) const':
/home/gilsun91/bitcoin-0.20/src/./coins.h:108: undefined reference to `SipHashUint256Extra(unsigned long, unsigned long, uint256 const&, unsigned int)'
collect2: error: ld returned 1 exit status
make(2): *** (Makefile:7584: bitcoin-tx) Error 1
make(2): *** Waiting for unfinished jobs....
/usr/bin/ld: libbitcoin_common.a(libbitcoin_common_a-coins.o): in function `SaltedOutpointHasher::operator()(COutPoint const&) const':
/home/gilsun91/bitcoin-0.20/src/./coins.h:108: undefined reference to `SipHashUint256Extra(unsigned long, unsigned long, uint256 const&, unsigned int)'
collect2: error: ld returned 1 exit status
make(2): *** (Makefile:7588: bitcoin-wallet) Error 1
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net.o): in function `CConnman::ConnectNode(CAddress, char const*, bool, bool, bool)':
/home/gilsun91/bitcoin-0.20/src/net.cpp:445: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net.cpp:445: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net.o): in function `CConnman::AcceptConnection(CConnman::ListenSocket const&)':
/home/gilsun91/bitcoin-0.20/src/net.cpp:1028: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net.cpp:1028: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net.o): in function `CConnman::GetDeterministicRandomizer(unsigned long) const':
/home/gilsun91/bitcoin-0.20/src/net.cpp:2821: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net.cpp:2821: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net.o): in function `CConnman::CalculateKeyedNetGroup(CAddress const&) const':
/home/gilsun91/bitcoin-0.20/src/net.cpp:2828: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net.cpp:2828: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net_processing.o): in function `RelayAddress(CAddress const&, bool, CConnman const&)::{lambda(CNode*)#1}::operator()(CNode*) const':
/home/gilsun91/bitcoin-0.20/src/net_processing.cpp:1396: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net_processing.cpp:1396: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net_processing.o): in function `RelayAddress(CAddress const&, bool, CConnman const&)':
/home/gilsun91/bitcoin-0.20/src/net_processing.cpp:1388: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net_processing.cpp:1388: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net_processing.o): in function `SaltedTxidHasher::operator()(uint256 const&) const':
/home/gilsun91/bitcoin-0.20/src/./txmempool.h:367: undefined reference to `SipHashUint256(unsigned long, unsigned long, uint256 const&)'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-txdb.o): in function `SaltedOutpointHasher::operator()(COutPoint const&) const':
/home/gilsun91/bitcoin-0.20/src/./coins.h:108: undefined reference to `SipHashUint256Extra(unsigned long, unsigned long, uint256 const&, unsigned int)'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-blockencodings.o): in function `CBlockHeaderAndShortTxIDs::GetShortID(uint256 const&) const':
/home/gilsun91/bitcoin-0.20/src/blockencodings.cpp:44: undefined reference to `SipHashUint256(unsigned long, unsigned long, uint256 const&)'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-blockfilter.o): in function `GCSFilter::HashToRange(std::vector<unsigned char, std::allocator<unsigned char> > const&) const':
/home/gilsun91/bitcoin-0.20/src/blockfilter.cpp:90: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/blockfilter.cpp:91: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/blockfilter.cpp:92: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_util.a(libbitcoin_util_a-bytevectorhash.o): in function `ByteVectorHash::operator()(std::vector<unsigned char, std::allocator<unsigned char> > const&) const':
/home/gilsun91/bitcoin-0.20/src/util/bytevectorhash.cpp:17: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/util/bytevectorhash.cpp:17: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/util/bytevectorhash.cpp:17: undefined reference to `CSipHasher::Finalize() const'
collect2: error: ld returned 1 exit status
make(2): *** (Makefile:7592: bitcoind) Error 1
/usr/bin/ld: test/test_bitcoin-blockencodings_tests.o: in function `SaltedTxidHasher::operator()(uint256 const&) const':
/home/gilsun91/bitcoin-0.20/src/./txmempool.h:367: undefined reference to `SipHashUint256(unsigned long, unsigned long, uint256 const&)'
/usr/bin/ld: test/test_bitcoin-coins_tests.o: in function `SaltedOutpointHasher::operator()(COutPoint const&) const':
/home/gilsun91/bitcoin-0.20/src/./coins.h:108: undefined reference to `SipHashUint256Extra(unsigned long, unsigned long, uint256 const&, unsigned int)'
/usr/bin/ld: test/test_bitcoin-crypto_tests.o: in function `crypto_tests::TestPoly1305(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/gilsun91/bitcoin-0.20/src/test/crypto_tests.cpp:169: undefined reference to `poly1305_auth(unsigned char*, unsigned char const*, unsigned long, unsigned char const*)'
/usr/bin/ld: test/test_bitcoin-crypto_tests.o: in function `crypto_tests::TestHKDF_SHA256_32(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/gilsun91/bitcoin-0.20/src/test/crypto_tests.cpp:183: undefined reference to `CHKDF_HMAC_SHA256_L32::CHKDF_HMAC_SHA256_L32(unsigned char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/crypto_tests.cpp:185: undefined reference to `CHKDF_HMAC_SHA256_L32::Expand32(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)'
/usr/bin/ld: test/test_bitcoin-crypto_tests.o: in function `crypto_tests::TestChaCha20Poly1305AEAD(bool, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/gilsun91/bitcoin-0.20/src/test/crypto_tests.cpp:614: undefined reference to `ChaCha20Poly1305AEAD::ChaCha20Poly1305AEAD(unsigned char const*, unsigned long, unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/crypto_tests.cpp:620: undefined reference to `ChaCha20Poly1305AEAD::Crypt(unsigned long, unsigned long, int, unsigned char*, unsigned long, unsigned char const*, unsigned long, bool)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/crypto_tests.cpp:643: undefined reference to `ChaCha20Poly1305AEAD::Crypt(unsigned long, unsigned long, int, unsigned char*, unsigned long, unsigned char const*, unsigned long, bool)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/crypto_tests.cpp:645: undefined reference to `ChaCha20Poly1305AEAD::GetLength(unsigned int*, unsigned long, int, unsigned char const*)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/crypto_tests.cpp:647: undefined reference to `ChaCha20Poly1305AEAD::Crypt(unsigned long, unsigned long, int, unsigned char*, unsigned long, unsigned char const*, unsigned long, bool)'
/usr/bin/ld: test/test_bitcoin-hash_tests.o: in function `hash_tests::siphash::test_method()':
/home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:82: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:83: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:85: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:86: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:88: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:89: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:90: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:91: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:93: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:94: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:96: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:97: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:99: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:100: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:101: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:102: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:103: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:104: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:106: undefined reference to `SipHashUint256(unsigned long, unsigned long, uint256 const&)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:109: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:112: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:113: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:116: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:119: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:121: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:130: undefined reference to `SipHashUint256(unsigned long, unsigned long, uint256 const&)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:141: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:142: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:144: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:145: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:145: undefined reference to `SipHashUint256(unsigned long, unsigned long, uint256 const&)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:146: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/test/hash_tests.cpp:146: undefined reference to `SipHashUint256Extra(unsigned long, unsigned long, uint256 const&, unsigned int)'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-blockencodings.o): in function `CBlockHeaderAndShortTxIDs::GetShortID(uint256 const&) const':
/home/gilsun91/bitcoin-0.20/src/blockencodings.cpp:44: undefined reference to `SipHashUint256(unsigned long, unsigned long, uint256 const&)'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-blockfilter.o): in function `GCSFilter::HashToRange(std::vector<unsigned char, std::allocator<unsigned char> > const&) const':
/home/gilsun91/bitcoin-0.20/src/blockfilter.cpp:90: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/blockfilter.cpp:91: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/blockfilter.cpp:92: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net.o): in function `CConnman::ConnectNode(CAddress, char const*, bool, bool, bool)':
/home/gilsun91/bitcoin-0.20/src/net.cpp:445: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net.cpp:445: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net.o): in function `CConnman::AcceptConnection(CConnman::ListenSocket const&)':
/home/gilsun91/bitcoin-0.20/src/net.cpp:1028: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net.cpp:1028: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net.o): in function `CConnman::GetDeterministicRandomizer(unsigned long) const':
/home/gilsun91/bitcoin-0.20/src/net.cpp:2821: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net.cpp:2821: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net.o): in function `CConnman::CalculateKeyedNetGroup(CAddress const&) const':
/home/gilsun91/bitcoin-0.20/src/net.cpp:2828: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net.cpp:2828: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net_processing.o): in function `RelayAddress(CAddress const&, bool, CConnman const&)::{lambda(CNode*)#1}::operator()(CNode*) const':
/home/gilsun91/bitcoin-0.20/src/net_processing.cpp:1396: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net_processing.cpp:1396: undefined reference to `CSipHasher::Finalize() const'
/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-net_processing.o): in function `RelayAddress(CAddress const&, bool, CConnman const&)':
/home/gilsun91/bitcoin-0.20/src/net_processing.cpp:1388: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/net_processing.cpp:1388: undefined reference to `CSipHasher::Write(unsigned long)'
/usr/bin/ld: libbitcoin_util.a(libbitcoin_util_a-bytevectorhash.o): in function `ByteVectorHash::operator()(std::vector<unsigned char, std::allocator<unsigned char> > const&) const':
/home/gilsun91/bitcoin-0.20/src/util/bytevectorhash.cpp:17: undefined reference to `CSipHasher::CSipHasher(unsigned long, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/util/bytevectorhash.cpp:17: undefined reference to `CSipHasher::Write(unsigned char const*, unsigned long)'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/util/bytevectorhash.cpp:17: undefined reference to `CSipHasher::Finalize() const'
collect2: error: ld returned 1 exit status
make(2): *** (Makefile:8551: test/test_bitcoin) Error 1
make(2): Leaving directory '/home/gilsun91/bitcoin-0.20/src'
make(1): *** (Makefile:17887: all-recursive) Error 1
make(1): Leaving directory '/home/gilsun91/bitcoin-0.20/src'
make: *** (Makefile:781: all-recursive) Error 1

in src/Makefile.am , I add some contents below:

366 # crypto primitives library
367 crypto_libbitcoin_crypto_base_a_CPPFLAGS = $(AM_CPPFLAGS)
368 crypto_libbitcoin_crypto_base_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
369 crypto_libbitcoin_crypto_base_a_SOURCES = 
370   crypto/aes.cpp 
371   crypto/aes.h 
372   crypto/chacha_poly_aead.h 
373   crypto/chacha_poly_aead.cpp 
374   crypto/chacha20.h 
375   crypto/chacha20.cpp 
376   crypto/common.h 
377   crypto/hkdf_sha256_32.cpp 
378   crypto/hkdf_sha256_32.h 
379   crypto/hmac_sha256.cpp 
380   crypto/hmac_sha256.h 
381   crypto/hmac_sha512.cpp 
382   crypto/hmac_sha512.h 
383   crypto/poly1305.h 
384   crypto/poly1305.cpp 
385   crypto/ripemd160.cpp 
386   crypto/ripemd160.h 
387   crypto/sha1.cpp 
388   crypto/sha1.h 
389   crypto/sha256.cpp 
390   crypto/sha256.h 
391   crypto/sha512.cpp 
392   crypto/sha512.h 
393   crypto/siphash.cpp 
394   crypto/siphash.h 
395   crypto/x13hash/aes_helper.c 
396   crypto/x13hash/blake.c  
397   crypto/x13hash/bmw.c  
398   crypto/x13hash/cubehash.c  
399   crypto/x13hash/echo.c  
400   crypto/x13hash/fugue.c  
401   crypto/x13hash/groestl.c  
402   crypto/x13hash/hamsi_helper.c  
403   crypto/x13hash/hamsi.c  
404   crypto/x13hash/jh.c  
405   crypto/x13hash/keccak.c  
406   crypto/x13hash/luffa.c  
407   crypto/x13hash/shavite.c  
408   crypto/x13hash/simd.c  
409   crypto/x13hash/skein.c  
410   crypto/x13hash/sm3.c  
411   crypto/x13hash/sph_blake.h  
412   crypto/x13hash/sph_bmw.h  
413   crypto/x13hash/sph_cubehash.h  
414   crypto/x13hash/sph_echo.h  
415   crypto/x13hash/sph_fugue.h  
416   crypto/x13hash/sph_groestl.h  
417   crypto/x13hash/sph_hamsi.h  
418   crypto/x13hash/sph_jh.h  
419   crypto/x13hash/sph_keccak.h  
420   crypto/x13hash/sph_luffa.h  
421   crypto/x13hash/sph_shavite.h  
422   crypto/x13hash/sph_simd.h  
423   crypto/x13hash/sph_skein.h  
424   crypto/x13hash/sph_sm3.h  
425   crypto/x13hash/sph_types.h

I add a new function in block.h below

class CBlockHeader
{
public:
    // header
    int32_t nVersion;
    uint256 hashPrevBlock;
    uint256 hashMerkleRoot;
    uint32_t nTime;
    uint32_t nBits;
    uint32_t nNonce;

    CBlockHeader()
    {
        SetNull();
    }

    ADD_SERIALIZE_METHODS;

    template <typename Stream, typename Operation>
    inline void SerializationOp(Stream& s, Operation ser_action) {
        READWRITE(this->nVersion);
        READWRITE(hashPrevBlock);
        READWRITE(hashMerkleRoot);
        READWRITE(nTime);
        READWRITE(nBits);
        READWRITE(nNonce);
    }

    void SetNull()
    {
        nVersion = 0;
        hashPrevBlock.SetNull();
        hashMerkleRoot.SetNull();
        nTime = 0;
        nBits = 0;
        nNonce = 0;
    }

    bool IsNull() const
    {
        return (nBits == 0);
    }

    uint256 GetHash() const;
    uint256 GetNewPoWHash() const; //new hash function

    int64_t GetBlockTime() const
    {
        return (int64_t)nTime;
    }
};

3, add the function in block.cpp

#include <hash.h>
#include <tinyformat.h>

#define BEGIN(a)            ((char*)&(a))
#define END(a)              ((char*)&((&(a))(1)))
#define UBEGIN(a)           ((unsigned char*)&(a))
#define UEND(a)             ((unsigned char*)&((&(a))(1)))
#define ARRAYLEN(array)     (sizeof(array)/sizeof((array)(0)))

uint256 CBlockHeader::GetHash() const
{
    return SerializeHash(*this);
}
uint256 CBlockHeader::GetNewPoWHash() const //new !! 
{   
    return HashX13sm3(BEGIN(nVersion), END(nNonce));
}

and rpc/mining.cpp:127: while (nMaxTries > 0 && pblock->nNonce < std::numeric_limits<uint32_t>::max() && !CheckProofOfWork(pblock->GetNewPoWHash(), pblock->nBits, Params().GetConsensus()) && !ShutdownRequested()) {
So ,how to solve it? Thank you very much.

apache 2.4 – mod_http2.so: undefined symbol: EVP_MD_CTX_new

After upgrading everything (yum update -y; reboot) on a CentOS 7 server which uses Apache, I’m getting this:

$ /usr/sbin/apachectl configtest
httpd: Syntax error on line 1 of /etc/httpd/conf/httpd.conf:
Syntax error on line 63 of /etc/httpd/conf.modules.d/000-web-base.conf:
Cannot load modules/mod_http2.so into server: /etc/httpd/modules/mod_http2.so:
undefined symbol: EVP_MD_CTX_new

I have Apache from CodeIT’s repository.
Do you know what the error above means? It works if I simply remove the “mod_http2” module, but this obviously isn’t ideal as I won’t benefit from HTTP2.

Server Version: Apache/2.4.48 (codeit) OpenSSL/1.1.1l
Server MPM: event
Server Built: May 26 2021 11:40:06

Cannot read property ‘preventDefault’ of undefined

I really need help here;
I am trying to submit a get request using data from select and input to fill in to the axios get request. Whenever i put event.preventDefault() on the submit function this error occurs
enter image description here

Onsubmit function

  const trackItem = (event) => {
      event.preventDefault()
        axios.get(`http://localhost:8080/api/?${tracktype}/${trackno}`)
        .then(res => setShipment(res.data))
        .catch(err => console.log(err))
  }

  useEffect(() => {
    trackItem()
  }, ());

the form

<form onSubmit={trackItem} >
            <select type="text"  name="tracktype" 
                    onChange={handleSelect}  value={tracktype} required>
                        <option value="" disabled label="Please select tracking options"/>
                        <option value="logisticsrecords" label="Track Shipment" />
                        <option value="storageshipment" label="Truck Storage"/>
                    </select>
                    <br/>
            <input type="text" placeholder="Insert Track number" name="tracknumber" 
                    onChange={handleTrackno} value={trackno} required/>
            <button type="submit"> Search </button>
        </form>

What could be the issue here?

bitcoin core development – so many “undefined reference to” after I add some codes, how to solve it?

I am just want to modify the hash algorithm of bitcoin-0.20 and I want to replace the previous hash algorithm to the x13hash algorithm. So I modify the source below,

1, I add the x13hash files to the bitcoin-0.20/src/crypto/x13hash, there are files below:

aes_helper.c  bmw.c       echo.c   groestl.c  hamsi_helper.c  keccak.c  shavite.c  skein.c  sph_blake.h  sph_cubehash.h  sph_fugue.h    sph_hamsi.h  sph_keccak.h  sph_shavite.h  sph_skein.h  sph_types.h
blake.c       cubehash.c  fugue.c  hamsi.c    jh.c            luffa.c   simd.c     sm3.c    sph_bmw.h    sph_echo.h      sph_groestl.h  sph_jh.h     sph_luffa.h   sph_simd.h     sph_sm3.h

2, I add a new function in block.h below

class CBlockHeader
{
public:
    // header
    int32_t nVersion;
    uint256 hashPrevBlock;
    uint256 hashMerkleRoot;
    uint32_t nTime;
    uint32_t nBits;
    uint32_t nNonce;

    CBlockHeader()
    {
        SetNull();
    }

    ADD_SERIALIZE_METHODS;

    template <typename Stream, typename Operation>
    inline void SerializationOp(Stream& s, Operation ser_action) {
        READWRITE(this->nVersion);
        READWRITE(hashPrevBlock);
        READWRITE(hashMerkleRoot);
        READWRITE(nTime);
        READWRITE(nBits);
        READWRITE(nNonce);
    }

    void SetNull()
    {
        nVersion = 0;
        hashPrevBlock.SetNull();
        hashMerkleRoot.SetNull();
        nTime = 0;
        nBits = 0;
        nNonce = 0;
    }

    bool IsNull() const
    {
        return (nBits == 0);
    }

    uint256 GetHash() const;
    uint256 GetNewPoWHash() const; //new hash function

    int64_t GetBlockTime() const
    {
        return (int64_t)nTime;
    }
};

3, add the function in block.cpp

#include <hash.h>
#include <tinyformat.h>

#define BEGIN(a)            ((char*)&(a))
#define END(a)              ((char*)&((&(a))(1)))
#define UBEGIN(a)           ((unsigned char*)&(a))
#define UEND(a)             ((unsigned char*)&((&(a))(1)))
#define ARRAYLEN(array)     (sizeof(array)/sizeof((array)(0)))

uint256 CBlockHeader::GetHash() const
{
    return SerializeHash(*this);
}
uint256 CBlockHeader::GetNewPoWHash() const //new !! 
{   
    return HashX13sm3(BEGIN(nVersion), END(nNonce));
}
  1. modify the hash.h below:

     #include <vector>
     // added new
     #include "crypto/x13hash/sph_blake.h"
     #include "crypto/x13hash/sph_bmw.h"
     #include "crypto/x13hash/sph_groestl.h"
     #include "crypto/x13hash/sph_jh.h"
     #include "crypto/x13hash/sph_keccak.h"
     #include "crypto/x13hash/sph_skein.h"
     #include "crypto/x13hash/sph_luffa.h"
     #include "crypto/x13hash/sph_cubehash.h"
     #include "crypto/x13hash/sph_shavite.h"
     #include "crypto/x13hash/sph_simd.h"
     #include "crypto/x13hash/sph_echo.h"
     #include "crypto/x13hash/sph_hamsi.h"
     #include "crypto/x13hash/sph_fugue.h"
     #include "crypto/x13hash/sph_sm3.h"
    
     #ifdef GLOBALDEFINED
     #define GLOBAL
     #else
     #define GLOBAL extern
     #endif
    
     GLOBAL sph_blake512_context     z_blake;
     GLOBAL sph_bmw512_context       z_bmw;
     GLOBAL sph_groestl512_context   z_groestl;
     GLOBAL sph_jh512_context        z_jh;
     GLOBAL sph_keccak512_context    z_keccak;
     GLOBAL sph_skein512_context     z_skein;
     GLOBAL sph_luffa512_context     z_luffa;
     GLOBAL sph_cubehash512_context  z_cubehash;
     GLOBAL sph_shavite512_context   z_shavite;
     GLOBAL sph_simd512_context      z_simd;
     GLOBAL sph_echo512_context      z_echo;
     GLOBAL sph_hamsi512_context     z_hamsi;
     GLOBAL sph_fugue512_context     z_fugue;
     #define fillz() do { 
         sph_blake512_init(&z_blake); 
         sph_bmw512_init(&z_bmw); 
         sph_groestl512_init(&z_groestl); 
         sph_jh512_init(&z_jh); 
         sph_keccak512_init(&z_keccak); 
         sph_skein512_init(&z_skein); 
         sph_luffa512_init(&z_luffa); 
         sph_cubehash512_init(&z_cubehash); 
         sph_shavite512_init(&z_shavite); 
         sph_simd512_init(&z_simd); 
         sph_echo512_init(&z_echo); 
         sph_hamsi512_init(&z_hamsi); 
         sph_fugue512_init(&z_fugue); 
     } while (0) 
     typedef uint256 ChainCode;
     template<typename T1>
    

    inline uint256 HashX13(const T1 pbegin, const T1 pend)

    {
    sph_blake512_context ctx_blake;
    sph_bmw512_context ctx_bmw;
    sph_groestl512_context ctx_groestl;
    sph_jh512_context ctx_jh;
    sph_keccak512_context ctx_keccak;
    sph_skein512_context ctx_skein;
    sph_luffa512_context ctx_luffa;
    sph_cubehash512_context ctx_cubehash;
    sph_shavite512_context ctx_shavite;
    sph_simd512_context ctx_simd;
    sph_echo512_context ctx_echo;
    sph_hamsi512_context ctx_hamsi;
    sph_fugue512_context ctx_fugue;
    static unsigned char pblank(1);

    #ifndef QT_NO_DEBUG
    //std::string strhash;
    //strhash = “”;
    #endif

     uint256 hash(34);
    
     sph_blake512_init(&ctx_blake);
     sph_blake512 (&ctx_blake, (pbegin == pend ? pblank : static_cast<const void*>(&pbegin(0))), (pend - pbegin) * sizeof(pbegin(0)));
     sph_blake512_close(&ctx_blake, static_cast<void*>(&hash(0)));
    
     sph_bmw512_init(&ctx_bmw);
     sph_bmw512 (&ctx_bmw, static_cast<const void*>(&hash(0)), 64);
     sph_bmw512_close(&ctx_bmw, static_cast<void*>(&hash(2)));
    
     sph_groestl512_init(&ctx_groestl);
     sph_groestl512 (&ctx_groestl, static_cast<const void*>(&hash(2)), 64);
     sph_groestl512_close(&ctx_groestl, static_cast<void*>(&hash(4)));
    
     sph_skein512_init(&ctx_skein);
     sph_skein512 (&ctx_skein, static_cast<const void*>(&hash(4)), 64);
     sph_skein512_close(&ctx_skein, static_cast<void*>(&hash(6)));
    
     sph_jh512_init(&ctx_jh);
     sph_jh512 (&ctx_jh, static_cast<const void*>(&hash(6)), 64);
     sph_jh512_close(&ctx_jh, static_cast<void*>(&hash(8)));
    
     sph_keccak512_init(&ctx_keccak);
     sph_keccak512 (&ctx_keccak, static_cast<const void*>(&hash(8)), 64);
     sph_keccak512_close(&ctx_keccak, static_cast<void*>(&hash(10)));
    
     sph_luffa512_init(&ctx_luffa);
     sph_luffa512 (&ctx_luffa, static_cast<void*>(&hash(10)), 64);
     sph_luffa512_close(&ctx_luffa, static_cast<void*>(&hash(12)));
    
     sph_cubehash512_init(&ctx_cubehash);
     sph_cubehash512 (&ctx_cubehash, static_cast<const void*>(&hash(12)), 64);
     sph_cubehash512_close(&ctx_cubehash, static_cast<void*>(&hash(14)));
    
     sph_shavite512_init(&ctx_shavite);
     sph_shavite512(&ctx_shavite, static_cast<const void*>(&hash(14)), 64);
     sph_shavite512_close(&ctx_shavite, static_cast<void*>(&hash(16)));
    
     sph_simd512_init(&ctx_simd);
     sph_simd512 (&ctx_simd, static_cast<const void*>(&hash(16)), 64);
     sph_simd512_close(&ctx_simd, static_cast<void*>(&hash(18)));
    
     sph_echo512_init(&ctx_echo);
     sph_echo512 (&ctx_echo, static_cast<const void*>(&hash(18)), 64);
     sph_echo512_close(&ctx_echo, static_cast<void*>(&hash(20)));
    
     sph_hamsi512_init(&ctx_hamsi);
     sph_hamsi512 (&ctx_hamsi, static_cast<const void*>(&hash(20)), 64);
     sph_hamsi512_close(&ctx_hamsi, static_cast<void*>(&hash(22)));
    
     sph_fugue512_init(&ctx_fugue);
     sph_fugue512 (&ctx_fugue, static_cast<const void*>(&hash(22)), 64);
     sph_fugue512_close(&ctx_fugue, static_cast<void*>(&hash(24)));
    
    
     return hash(24);
    

    }

template
inline uint256 HashX13sm3(const T1 pbegin, const T1 pend)
{
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;
sph_groestl512_context ctx_groestl;
sph_jh512_context ctx_jh;
sph_keccak512_context ctx_keccak;
sph_skein512_context ctx_skein;
sm3_ctx_t ctx_sm3;
sph_cubehash512_context ctx_cubehash;
sph_shavite512_context ctx_shavite;
sph_simd512_context ctx_simd;
sph_echo512_context ctx_echo;
sph_hamsi512_context ctx_hamsi;
sph_fugue512_context ctx_fugue;
static unsigned char pblank(1);

#ifndef QT_NO_DEBUG
//std::string strhash;
//strhash = “”;
#endif

uint256 hash(34);

sph_blake512_init(&ctx_blake);
sph_blake512 (&ctx_blake, (pbegin == pend ? pblank : static_cast<const void*>(&pbegin(0))), (pend - pbegin) * sizeof(pbegin(0)));
sph_blake512_close(&ctx_blake, static_cast<void*>(&hash(0)));

sph_bmw512_init(&ctx_bmw);
sph_bmw512 (&ctx_bmw, static_cast<const void*>(&hash(0)), 64);
sph_bmw512_close(&ctx_bmw, static_cast<void*>(&hash(2)));

    sph_groestl512_init(&ctx_groestl);
    sph_groestl512 (&ctx_groestl, static_cast<const void*>(&hash(2)), 64);
    sph_groestl512_close(&ctx_groestl, static_cast<void*>(&hash(4)));

    sph_skein512_init(&ctx_skein);
    sph_skein512 (&ctx_skein, static_cast<const void*>(&hash(4)), 64);
    sph_skein512_close(&ctx_skein, static_cast<void*>(&hash(6)));

    sph_jh512_init(&ctx_jh);
    sph_jh512 (&ctx_jh, static_cast<const void*>(&hash(6)), 64);
    sph_jh512_close(&ctx_jh, static_cast<void*>(&hash(8)));

    sph_keccak512_init(&ctx_keccak);
    sph_keccak512 (&ctx_keccak, static_cast<const void*>(&hash(8)), 64);
    sph_keccak512_close(&ctx_keccak, static_cast<void*>(&hash(10)));

    hash(12).SetNull(); //sm3 is 256bit, just in case
    hash(13).SetNull();
    sm3_init(&ctx_sm3);
    sph_sm3(&ctx_sm3, static_cast<const void*>(&hash(10)), 64);
    sph_sm3_close(&ctx_sm3, static_cast<void*>(&hash(12)));

    sph_cubehash512_init(&ctx_cubehash);
    sph_cubehash512 (&ctx_cubehash, static_cast<const void*>(&hash(12)), 64);
    sph_cubehash512_close(&ctx_cubehash, static_cast<void*>(&hash(14)));

    sph_shavite512_init(&ctx_shavite);
    sph_shavite512(&ctx_shavite, static_cast<const void*>(&hash(14)), 64);
    sph_shavite512_close(&ctx_shavite, static_cast<void*>(&hash(16)));

    sph_simd512_init(&ctx_simd);
    sph_simd512 (&ctx_simd, static_cast<const void*>(&hash(16)), 64);
    sph_simd512_close(&ctx_simd, static_cast<void*>(&hash(18)));

    sph_echo512_init(&ctx_echo);
    sph_echo512 (&ctx_echo, static_cast<const void*>(&hash(18)), 64);
    sph_echo512_close(&ctx_echo, static_cast<void*>(&hash(20)));

    sph_hamsi512_init(&ctx_hamsi);
    sph_hamsi512 (&ctx_hamsi, static_cast<const void*>(&hash(20)), 64);
    sph_hamsi512_close(&ctx_hamsi, static_cast<void*>(&hash(22)));

    sph_fugue512_init(&ctx_fugue);
    sph_fugue512 (&ctx_fugue, static_cast<const void*>(&hash(22)), 64);
    sph_fugue512_close(&ctx_fugue, static_cast<void*>(&hash(24)));


    return hash(24);
} /* added new above */
typedef uint256 ChainCode;  

Finally then I make again ,it shows error below:

CXX      script/libbitcoin_common_a-descriptor.o
  CXX      script/libbitcoin_common_a-sign.o
  CXX      script/libbitcoin_common_a-signingprovider.o
  CXX      script/libbitcoin_common_a-standard.o
  AR       libbitcoin_util.a
  AR       libbitcoin_consensus.a
  AR       libbitcoin_wallet_tool.a
  AR       libtest_util.a
  CXXLD    libbitcoinconsensus.la
  AR       libbitcoin_server.a
  AR       libbitcoin_wallet.a
  AR       libbitcoin_common.a
  CXXLD    bitcoin-cli
  CXXLD    bitcoin-tx
  CXXLD    bitcoin-wallet
  CXXLD    bitcoind
  CXXLD    test/test_bitcoin
/usr/bin/ld: libbitcoin_consensus.a(libbitcoin_consensus_a-block.o): in function `uint256 HashX13sm3<char*>(char*, char*)':
/home/gilsun91/bitcoin-0.20/src/./hash.h:178: undefined reference to `sph_blake512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:179: undefined reference to `sph_blake512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:180: undefined reference to `sph_blake512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:182: undefined reference to `sph_bmw512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:183: undefined reference to `sph_bmw512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:184: undefined reference to `sph_bmw512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:186: undefined reference to `sph_groestl512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:187: undefined reference to `sph_groestl512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:188: undefined reference to `sph_groestl512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:190: undefined reference to `sph_skein512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:191: undefined reference to `sph_skein512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:192: undefined reference to `sph_skein512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:194: undefined reference to `sph_jh512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:195: undefined reference to `sph_jh512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:196: undefined reference to `sph_jh512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:198: undefined reference to `sph_keccak512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:199: undefined reference to `sph_keccak512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:200: undefined reference to `sph_keccak512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:204: undefined reference to `sm3_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:205: undefined reference to `sph_sm3'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:206: undefined reference to `sph_sm3_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:208: undefined reference to `sph_cubehash512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:209: undefined reference to `sph_cubehash512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:210: undefined reference to `sph_cubehash512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:212: undefined reference to `sph_shavite512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:213: undefined reference to `sph_shavite512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:214: undefined reference to `sph_shavite512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:216: undefined reference to `sph_simd512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:217: undefined reference to `sph_simd512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:218: undefined reference to `sph_simd512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:220: undefined reference to `sph_echo512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:221: undefined reference to `sph_echo512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:222: undefined reference to `sph_echo512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:224: undefined reference to `sph_hamsi512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:225: undefined reference to `sph_hamsi512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:226: undefined reference to `sph_hamsi512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:228: undefined reference to `sph_fugue512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:229: undefined reference to `sph_fugue512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:230: undefined reference to `sph_fugue512_close'
collect2: error: ld returned 1 exit status
make(2): *** (Makefile:7370: bitcoin-tx) Error 1
make(2): *** Waiting for unfinished jobs....
/usr/bin/ld: libbitcoin_consensus.a(libbitcoin_consensus_a-block.o): in function `uint256 HashX13sm3<char*>(char*, char*)':
/home/gilsun91/bitcoin-0.20/src/./hash.h:178: undefined reference to `sph_blake512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:179: undefined reference to `sph_blake512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:180: undefined reference to `sph_blake512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:182: undefined reference to `sph_bmw512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:183: undefined reference to `sph_bmw512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:184: undefined reference to `sph_bmw512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:186: undefined reference to `sph_groestl512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:187: undefined reference to `sph_groestl512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:188: undefined reference to `sph_groestl512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:190: undefined reference to `sph_skein512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:191: undefined reference to `sph_skein512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:192: undefined reference to `sph_skein512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:194: undefined reference to `sph_jh512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:195: undefined reference to `sph_jh512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:196: undefined reference to `sph_jh512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:198: undefined reference to `sph_keccak512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:199: undefined reference to `sph_keccak512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:200: undefined reference to `sph_keccak512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:204: undefined reference to `sm3_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:205: undefined reference to `sph_sm3'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:206: undefined reference to `sph_sm3_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:208: undefined reference to `sph_cubehash512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:209: undefined reference to `sph_cubehash512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:210: undefined reference to `sph_cubehash512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:212: undefined reference to `sph_shavite512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:213: undefined reference to `sph_shavite512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:214: undefined reference to `sph_shavite512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:216: undefined reference to `sph_simd512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:217: undefined reference to `sph_simd512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:218: undefined reference to `sph_simd512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:220: undefined reference to `sph_echo512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:221: undefined reference to `sph_echo512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:222: undefined reference to `sph_echo512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:224: undefined reference to `sph_hamsi512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:225: undefined reference to `sph_hamsi512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:226: undefined reference to `sph_hamsi512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:228: undefined reference to `sph_fugue512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:229: undefined reference to `sph_fugue512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:230: undefined reference to `sph_fugue512_close'
collect2: error: ld returned 1 exit status
make(2): *** (Makefile:7374: bitcoin-wallet) Error 1
/usr/bin/ld: libbitcoin_consensus.a(libbitcoin_consensus_a-block.o): in function `uint256 HashX13sm3<char*>(char*, char*)':
/home/gilsun91/bitcoin-0.20/src/./hash.h:178: undefined reference to `sph_blake512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:179: undefined reference to `sph_blake512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:180: undefined reference to `sph_blake512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:182: undefined reference to `sph_bmw512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:183: undefined reference to `sph_bmw512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:184: undefined reference to `sph_bmw512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:186: undefined reference to `sph_groestl512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:187: undefined reference to `sph_groestl512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:188: undefined reference to `sph_groestl512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:190: undefined reference to `sph_skein512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:191: undefined reference to `sph_skein512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:192: undefined reference to `sph_skein512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:194: undefined reference to `sph_jh512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:195: undefined reference to `sph_jh512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:196: undefined reference to `sph_jh512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:198: undefined reference to `sph_keccak512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:199: undefined reference to `sph_keccak512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:200: undefined reference to `sph_keccak512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:204: undefined reference to `sm3_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:205: undefined reference to `sph_sm3'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:206: undefined reference to `sph_sm3_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:208: undefined reference to `sph_cubehash512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:209: undefined reference to `sph_cubehash512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:210: undefined reference to `sph_cubehash512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:212: undefined reference to `sph_shavite512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:213: undefined reference to `sph_shavite512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:214: undefined reference to `sph_shavite512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:216: undefined reference to `sph_simd512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:217: undefined reference to `sph_simd512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:218: undefined reference to `sph_simd512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:220: undefined reference to `sph_echo512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:221: undefined reference to `sph_echo512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:222: undefined reference to `sph_echo512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:224: undefined reference to `sph_hamsi512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:225: undefined reference to `sph_hamsi512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:226: undefined reference to `sph_hamsi512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:228: undefined reference to `sph_fugue512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:229: undefined reference to `sph_fugue512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:230: undefined reference to `sph_fugue512_close'
collect2: error: ld returned 1 exit status
make(2): *** (Makefile:7378: bitcoind) Error 1
/usr/bin/ld: libbitcoin_consensus.a(libbitcoin_consensus_a-block.o): in function `uint256 HashX13sm3<char*>(char*, char*)':
/home/gilsun91/bitcoin-0.20/src/./hash.h:178: undefined reference to `sph_blake512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:179: undefined reference to `sph_blake512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:180: undefined reference to `sph_blake512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:182: undefined reference to `sph_bmw512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:183: undefined reference to `sph_bmw512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:184: undefined reference to `sph_bmw512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:186: undefined reference to `sph_groestl512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:187: undefined reference to `sph_groestl512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:188: undefined reference to `sph_groestl512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:190: undefined reference to `sph_skein512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:191: undefined reference to `sph_skein512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:192: undefined reference to `sph_skein512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:194: undefined reference to `sph_jh512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:195: undefined reference to `sph_jh512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:196: undefined reference to `sph_jh512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:198: undefined reference to `sph_keccak512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:199: undefined reference to `sph_keccak512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:200: undefined reference to `sph_keccak512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:204: undefined reference to `sm3_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:205: undefined reference to `sph_sm3'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:206: undefined reference to `sph_sm3_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:208: undefined reference to `sph_cubehash512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:209: undefined reference to `sph_cubehash512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:210: undefined reference to `sph_cubehash512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:212: undefined reference to `sph_shavite512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:213: undefined reference to `sph_shavite512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:214: undefined reference to `sph_shavite512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:216: undefined reference to `sph_simd512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:217: undefined reference to `sph_simd512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:218: undefined reference to `sph_simd512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:220: undefined reference to `sph_echo512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:221: undefined reference to `sph_echo512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:222: undefined reference to `sph_echo512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:224: undefined reference to `sph_hamsi512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:225: undefined reference to `sph_hamsi512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:226: undefined reference to `sph_hamsi512_close'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:228: undefined reference to `sph_fugue512_init'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:229: undefined reference to `sph_fugue512'
/usr/bin/ld: /home/gilsun91/bitcoin-0.20/src/./hash.h:230: undefined reference to `sph_fugue512_close'

ajax – Json response return undefined value in Laravel on blade file

ajax – Json response return undefined value in Laravel on blade file – Stack Overflow

blocks – Magento 2.4.3 – Notice: Undefined property: $_view – Decomposition of Controllers

I have been trying to create module in Magento 2.4.3 that has significant changes where decomposition is favored instead of inheritance – https://community.magento.com/t5/Magento-DevBlog/Decomposition-of-Magento-Controllers/ba-p/430883

The below code is successfully working in 2.2 however is throwing error even after changing classes and running in version 2.4.3. Unable to load the users.phtml file that will be called using the controller and block while throwing error – Undefined property: $_view

Controller – VendorMyModuleControllerIndex.php

<?php

namespace EinfochipsSalesStaffController;

use MagentoFrameworkAppActionHttpGetActionInterface;
use MagentoFrameworkViewResultPageFactory;

class Index implements HttpGetActionInterface
{
    /** @var PageFactory */
    protected $resultPageFactory;
    public function __construct(PageFactory $resultPageFactory)
    {
        $this->resultPageFactory = $resultPageFactory;
    }

    public function execute()
    {
        return $this->resultPageFactory->create();
    }
}

Controller – VendorMyModuleControllerIndexIndex.php

<?php
namespace VendorMyModuleControllerIndex;

use MagentoFrameworkAppActionHttpGetActionInterface;
use MagentoFrameworkViewResultPageFactory;

class Index extends VendorMyModuleControllerIndex
{

    protected $resultPageFactory;
    public function __construct(PageFactory $resultPageFactory)
    {
        $this->resultPageFactory = $resultPageFactory;
    }

    public function execute()
    {
 
            $resultPage = $this->resultPageFactory->create();
            $resultPage->getConfig()->getTitle()->set(__('Users'));
            $this->_view->getLayout()->getBlock('page.main.title')->setPageTitle('Users');
            return $resultPage;
    }
}

Block – VendorMyModuleBlockUsers.php

<?php
namespace VendorMyModuleBlock;

use MagentoFrameworkViewElementTemplateContext;
use MagentoFrameworkAppRequestInterface;
use MagentoStoreModelStoreManagerInterface;

class Users extends MagentoFrameworkViewElementTemplate {

    public function __construct(
            Context $context, 
            RequestInterface $request,
            StoreManagerInterface $storeManager,
            array $data = ()
    ) {
        $this->request = $request;  
        $this->storeManager = $storeManager;
        parent::__construct($context, $data);
    }
}

XML – VendorMyModuleviewfrontendlayoutusers_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <body>
        <referenceContainer name="content">
            <block class="CompanyMyModuleBlockModuleAddUser" name="add_users" as="add_users" 
            template="Vendor_MyModule::addusers.phtml" cacheable="false"/>
        </referenceContainer>
    </body>
</page>

users.phtml – VendorMyModuleviewfrontendtemplatesusers.phtml

<?php echo 'Test PHTML'; ?>

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies Proxies123.com