编译两个静态方法时发生gcc编译错误[已关闭]

jecbmhm3  于 2023-03-02  发布在  其他
关注(0)|答案(1)|浏览(177)

27分钟前就关门了。
Improve this question
当我尝试到编译这c++程序使用gcc它提示以下错误

Invoking: GCC C++ Compiler
g++ -I/usr/include/oracle/12.2/client64 -I/usr/include/log4cpp -I/usr/include/ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/util/UtilMethods.d" -MT"src/util/UtilMethods.o" -o "src/util/UtilMethods.o" "../src/util/UtilMethods.cpp"
In file included from ../src/util/UtilMethods.cpp:20:0:
../src/util/../databaseHandler/DbSessionManager.h: In static member function ‘static bool std::UtilMethods::isFuelMerchantExist(std::SessionManager*)’:
../src/util/../databaseHandler/DbSessionManager.h:151:14: error: ‘static void std::DbSessionManager::getFuelMerchantCode(std::SessionManager*)’ is private
  static void getFuelMerchantCode(SessionManager *s) ;
              ^
../src/util/UtilMethods.cpp:507:41: error: within this context
  DbSessionManager::getFuelMerchantCode(s);
                                         ^
../src/util/UtilMethods.cpp:508:21: error: variable ‘std::stringstream ss’ has initializer but incomplete type
     stringstream ss(s->TXN_SESSTION.DB_MERCHANT.FUEL_MERCHANT);

实用程序方法
x一个一个一个一个x一个一个二个x
你能找出错误的原因吗两个方法都被初始化为静态的

6mw9ycah

6mw9ycah1#

由于使用私有方法,因此发生此错误,更改为公共方法已解决此错误

相关问题