Çözüldü Ortalama Fiyat Bilgisi Build Sorunu

Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

LethalStrikeR

Yardımsever Üye
Yardımsever Üye
MT Üye
Mesaj
749
Çözümler
41
Beğeni
182
Puan
609
Ticaret Puanı
0
Linkleri görebilmek için giriş yap veya kayıt ol.


bu konuda ki sistemi eklerken cmd_general.cpp dosyasında böyle bir build hatası alıyorum.
Kod:
Genişlet Daralt Kopyala
cmd_general.cpp: In function 'void do_average_price(LPCHARACTER, const char*, int, int)':
cmd_general.cpp:637:15: error: 'CShopManager' has not been declared
  auto m_tch = CShopManager::instance().GetShopMap();
               ^
cmd_general.cpp:650:19: error: unable to deduce 'auto&&' from 'm_tch'
  for (auto iter : m_tch)
                   ^
cmd_general.cpp:659:37: error: invalid use of incomplete type 'class CShop'
   auto shop_items = tch->GetMyShop()->GetItemVector();
                                     ^
In file included from cmd_general.cpp:12:0:
char.h:548:7: error: forward declaration of 'class CShop'
class CShop;
       ^
cmd_general.cpp:663:20: error: unable to deduce 'auto&&' from 'shop_items'
   for (auto item : shop_items)
 
Çözüm
Shop.h Açılır aratılır;
C++:
Genişlet Daralt Kopyala
        DWORD    GetNPCVnum() { return m_dwNPCVnum; }
Altına bir boşluk bırakıp yapıştırılır:
C++:
Genişlet Daralt Kopyala
        std::vector<SHOP_ITEM>    GetItemVector() const { return m_itemVector; }
Sorun çözülmüştür. @Whistle konu kapanabilir.
cmd_general.cpp başına şu kodu ekleyip tekrar deneyin.
#include "shop_manager.h"
 
cmd_general.cpp başına şu kodu ekleyip tekrar deneyin.
#include "shop_manager.h"
Kod:
Genişlet Daralt Kopyala
cmd_general.cpp: In function 'void do_average_price(LPCHARACTER, const char*, int, int)':
cmd_general.cpp:653:32: error: invalid use of incomplete type 'class CShop'
   LPCHARACTER tch = iter.second->GetPC();
                                ^
In file included from cmd_general.cpp:12:0:
char.h:548:7: error: forward declaration of 'class CShop'
class CShop;
       ^
cmd_general.cpp:660:37: error: invalid use of incomplete type 'class CShop'
   auto shop_items = tch->GetMyShop()->GetItemVector();
                                     ^
In file included from cmd_general.cpp:12:0:
char.h:548:7: error: forward declaration of 'class CShop'
class CShop;
       ^
cmd_general.cpp:664:20: error: unable to deduce 'auto&&' from 'shop_items'
   for (auto item : shop_items)
                    ^
gmake[1]: *** [.obj/cmd_general.o] Error 1
 
Bunuda ekleyiniz.
#include "shop.h"
Bu seferde böyle bir hata verdi.
Kod:
Genişlet Daralt Kopyala
cmd_general.cpp: In function 'void do_average_price(LPCHARACTER, const char*, int, int)':
cmd_general.cpp:661:39: error: 'class CShop' has no member named 'GetItemVector'
   auto shop_items = tch->GetMyShop()->GetItemVector();
                                       ^
cmd_general.cpp:665:20: error: unable to deduce 'auto&&' from 'shop_items'
   for (auto item : shop_items)
                    ^
gmake[1]: *** [.obj/cmd_general.o] Error 1
gmake[1]: Leaving directory `/usr/src/1martysama/Server/game/src'
gmake: *** [all] Error 2
 
Shop.h Açılır aratılır;
C++:
Genişlet Daralt Kopyala
        DWORD    GetNPCVnum() { return m_dwNPCVnum; }
Altına bir boşluk bırakıp yapıştırılır:
C++:
Genişlet Daralt Kopyala
        std::vector<SHOP_ITEM>    GetItemVector() const { return m_itemVector; }
Sorun çözülmüştür. @Whistle konu kapanabilir.
 
Çözüm
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst