我正在尝试编译一个具有以下标题的项目:locale.h;
locale.h文件:
class LOG4CXX_EXPORT Locale
{
public:
...
protected:
Locale(const Locale&);
Locale& operator=(const Locale&);
const LogString language; <-- error
const LogString country; <-- error
const LogString variant; <-- error
}; // class Locale
Run Code Online (Sandbox Code Playgroud)
有人能给我一些建议吗?
我收到了这个错误.我不确定是什么问题.
/LOGGER/include/log4cxx/helpers/locale.h:42:41: error: field ‘language’ has incomplete type
const LogString language;
^
/LOGGER/include/log4cxx/helpers/locale.h:43:41: error: field ‘country’ has incomplete type
const LogString country;
^
/LOGGER/include/log4cxx/helpers/locale.h:44:41: error: field ‘variant’ has incomplete type
Run Code Online (Sandbox Code Playgroud) 安装后:
pip install virtualenv
Run Code Online (Sandbox Code Playgroud)
运行它会大喊:
C:\programs\python\Python27\Scripts>virtualenv.exe
Traceback (most recent call last):
File "C:\programs\python\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\programs\python\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\programs\python\Python27\Scripts\virtualenv.exe\__main__.py", line 5, in <module>
File "C:\programs\python\Python27\lib\site-packages\virtualenv\__init__.py", line 3, in <module>
from .run import cli_run, session_via_cli
File "C:\programs\python\Python27\lib\site-packages\virtualenv\run\__init__.py", line 7, in <module>
from ..app_data import make_app_data
File "C:\programs\python\Python27\lib\site-packages\virtualenv\app_data\__init__.py", line 9, in <module>
from platformdirs import user_data_dir
ImportError: No module named platformdirs
Run Code Online (Sandbox Code Playgroud)
有什么想法为什么会发生这种情况吗?点 1.5.6
我有以下代码,我想在使用GCC 4.8的Linux上工作
这与VS 2013一起使用
if ( _access( trigger->c_str(), 0 ) != -1 )
{
...
}
Run Code Online (Sandbox Code Playgroud)
我知道在Linux上我可以使用函数:从"unistd.h"访问
有没有办法避免像下面这样的东西(更优雅的解决方案)?
#ifdef __linux__
#include <unistd.h>
#endif
#ifdef __linux__
if ( access( trigger->c_str(), 0 ) != -1 )
{
...
}
#else
if ( _access( trigger->c_str(), 0 ) != -1 )
{
...
}
#endif
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用GNU在Linux上的Eclipse CDT中构建以下代码:
log_defs.h
#pragma once
#define dbg_log(fmt, ...) debug_logger::debug(__FILE__, __FUNCTION__, __LINE__, fmt, __VA_ARGS__, 0)
Run Code Online (Sandbox Code Playgroud)
ErrorMessage.cpp
ErrorMessage::ErrorMessage( void ){ dbg_log( L"ErrorMessage::ErrorMessage _in" ); }
ErrorMessage::~ErrorMessage( void ){ dbg_log( L"ErrorMessage::~ErrorMessage _in" ); }
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
../sources/ErrorMessage.cpp: In constructor ‘ErrorMessage::ErrorMessage()’:
/include/log_defs.h:27:97: error: expected primary-expression before ‘,’ token
#define dbg_log(fmt, ...) debug_logger::debug(__FILE__, __FUNCTION__, __LINE__, fmt, __VA_ARGS__, 0)
^
../sources/ErrorMessage.cpp:150:37: note: in expansion of macro ‘dbg_log’
ErrorMessage::ErrorMessage( void ){ dbg_log( L"ErrorMessage::ErrorMessage _in" ); }
^
../sources/ErrorMessage.cpp: In destructor ‘ErrorMessage::~ErrorMessage()’:
/include/log_defs.h:27:97: error: expected primary-expression before ‘,’ token …Run Code Online (Sandbox Code Playgroud) 我想在 GCC C++ Linker 的 Miscellaneous 部分指定多个 rpath。
链接器标志:
-Wl,-rpath=/home/cri/Libs1, -Wl,-rpath=/home/cri/Libs2
对于一个它正在工作,但是当我添加第二个时,我收到此错误:
/usr/bin/ld: cannot find : No such file or directory
collect2: ld returned 1 exit status
make: *** [libmylib.so] Error 1
Run Code Online (Sandbox Code Playgroud)
我可以就我做错的事情得到一些帮助吗?
c++ ×4
eclipse ×2
gcc ×2
gnu ×1
header ×1
installation ×1
linker ×1
linux ×1
pip ×1
python ×1
python-2.x ×1
virtualenv ×1