linker option to list libraries used

I am working on a Linux platform and using the GNU C++ compiler. I am trying to resolve a link error that says some symbols are undefined. I can go find libraries with the name provided on the command line, and see that they contain the symbols in question ( using the 'nm' utility ). I know that for the compilation step, I can use the command-line flag '-H' instead of '-c&

链接器选项列出使用的库

我正在开发一个Linux平台并使用GNU C ++编译器。 我想解决一个链接错误,说一些符号是未定义的。 我可以使用命令行提供的名称查找库,并查看它们是否包含有问题的符号(使用'nm'实用程序)。 我知道在编译步骤中,我可以使用命令行标志'-H'而不是'-c'来获取#include到编译中的头文件列表。 链接器是否有类似的选项? 我想如果我能看到链接器用来处理每个'-lmylibrary'标志的文件列表,我

C++1z coroutine threading context and coroutine scheduling

Per this latest C++ TS: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/n4628.pdf, and based on the understanding of C# async/await language support, I'm wondering what is the "execution context" (terminology borrowed from C#) of the C++ coroutines? My simple test code in Visual C++ 2017 RC reveals that coroutines seem to always execute on a thread pool thread, and little

C ++ 1z协程线程上下文和协程调度

根据最新的C ++ TS:http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/n4628.pdf,基于对C#异步/等待语言支持的理解,我想知道什么是C ++协程的“执行上下文”(从C#借用的术语)? 我在Visual C ++ 2017 RC中的简单测试代码揭示了协程似乎总是在一个线程池线程上执行,并且很少控制应用程序开发人员在其上执行协程的线程上下文 - 例如,应用程序是否可以强制所有协程与编译器生成的状态机代码)只能在主线程上执行,

c++

I'm aware of an idiom or pattern for coroutines in C and C++: struct cofunctor { int state = 0; void operator () () { switch ( state ) { case 0: // Caller must initialize to 0 if ( bar1 ) return; while ( bar2 ) { state = 1; case 1: if ( bar3 ) return; state = 2; case 2: if ( bar4 ) return;

C ++

我知道C和C ++中的协程的成语或模式: struct cofunctor { int state = 0; void operator () () { switch ( state ) { case 0: // Caller must initialize to 0 if ( bar1 ) return; while ( bar2 ) { state = 1; case 1: if ( bar3 ) return; state = 2; case 2: if ( bar4 ) return; } state = 3

State machine representation

I want to implement the GUI as a state machine. I think there are some benefits and some drawbacks of doing this, but this is not the topic of this questions. After some reading about this I found several ways of modeling a state machine in C++ and I stuck on 2, but I don't know what method may fit better for GUI modeling. Represent the State Machine as a list of states with following me

状态机表示

我想将GUI作为一个状态机来实现。 我认为这样做有一些好处和缺点,但这不是这个问题的主题。 在阅读了这篇文章后,我发现了几种使用C ++建模状态机的方法,但我坚持使用2,但我不知道哪种方法更适合GUI建模。 使用以下方法将状态机表示为状态列表: OnEvent(...); OnEnterState(...); OnExitState(...); 从StateMachine::OnEvent(...)我将该事件转发到CurrentState::OnEvent(...)并在这里做出是否做出转换的决定。

Stack allocation for C++ green threads

I'm doing some research in C++ green threads, mostly boost::coroutine2 and similar POSIX functions like makecontext()/swapcontext() , and planning to implement a C++ green thread library on top of boost::coroutine2 . Both require the user code to allocate a stack for every new function/coroutine. My target platform is x64/Linux. I want my green thread library to be suitable for general us

C ++绿色线程的堆栈分配

我在C ++绿色线程中进行了一些研究,主要是boost::coroutine2和类似的POSIX函数,如makecontext()/swapcontext() ,并计划在boost::coroutine2之上实现一个C ++绿色线程库。 两者都需要用户代码为每个新函数/协程分配一个堆栈。 我的目标平台是x64 / Linux。 我希望我的绿色线程库适合一般用途,所以堆栈应该根据需要进行扩展(合理的上限是很好的,例如10MB),如果堆栈可能缩小,因为太多的内存不用(不是必需的)。 我还

UDP broadcasting for LAN computer discovery & server setup

I'm working on a small, networked game prototype which will be played on LANs using UDP. For the discovery of other computers on the network, I've been investigating broadcasting. However, I'm still unsure about a few details regarding UDP socket setup/usage (networking newbie). I found a good library to use after the game is started, but at first, all computers running the game mu

用于LAN计算机发现和服务器设置的UDP广播

我正在研究一个小型的网络游戏原型,它将在使用UDP的局域网上播放。 为了发现网络上的其他计算机,我一直在调查广播。 但是,我仍然不确定关于UDP套接字设置/使用(网络新手)的一些细节。 在游戏开始后,我发现了一个好的图书馆,但起初必须发现所有运行游戏的计算机,并且必须选择一台作为服务器。 所以我的问题如下: 是否可以使用单个UDP套接字来侦听和发送广播? 我很肯定这个答案是肯定的,但我想验证它。 当使用

Debug Visualizer use member method / function call in preview?

Using Visual Studio 2010 with native C++. When editing autoexp.dat, is it possible to use the results of a method call in a debug visualizer preview? For example, if my class is Person how can I do something like: MyNamespace::Person{ preview( #("FirstName=", $e->GetFirstName()) ) } (You may ask why I don't just get the private member variable data and that is because GetFirst

调试可视化器在预览中使用成员方法/函数调用?

使用Visual Studio 2010和本机C ++。 编辑autoexp.dat时,是否可以在调试可视化器预览中使用方法调用的结果? 例如,如果我的课程是Person,我该如何执行以下操作: MyNamespace::Person{ preview( #("FirstName=", $e->GetFirstName()) ) } (你可能会问为什么我不只是获得私有成员变量数据,这是因为GetFirstName()委托给第三方库方法调用,所以我没有访问数据成员的原因。另一个原因可能是方法执行一些计算

Widget under a QTabBar with unwanted frame

I have a problem with QTabBar/QTabWidget. This is what my program looks like at the moment, using QTabBar: As you can see, there is an unsightly line between the QTabBar and the QScrollArea underneath it. This line is part of the frame of the QScrollArea, which I can't simply get rid of, because it is required on the other three sides. I realise I could use QTabWidget, but then I would h

使用不需要的框架在QTabBar下的Widget

QTabBar / QTabWidget有问题。 这是我的程序在使用QTabBar的时候的样子: 正如你所看到的,QTabBar和它下面的QScrollArea之间有一条难看的线。 这条线是QScrollArea框架的一部分,我不能简单地摆脱它,因为它在其他三面都是必需的。 我意识到我可以使用QTabWidget,但是我必须为每个选项卡创建一个小部件,这在这里不可行:QScrollArea的内容根据选定的选项卡而变化,但只有一个QScrollArea小部件。 (每次创建新选项卡时

gettext character encoding

I have the following gettext .po file, which has been translated from a .pot file. I am working on a Linux system (openSUSE if it matters), running gettext 0.17. # # <translate@transme.de>, 2011 # transer <translate@transme.de>, 2011 msgid "" msgstr "" "Project-Id-Version: transtestn" "Report-Msgid-Bugs-To: n" "POT-Creation-Date: 2011-05-24 22:47+0100n" "PO-Revision-Date: 2011-05

gettext字符编码

我有以下gettext .po文件,该文件已从.pot文件转换而来。 我正在使用Linux系统(openSUSE,如果它很重要),运行gettext 0.17。 # # <translate@transme.de>, 2011 # transer <translate@transme.de>, 2011 msgid "" msgstr "" "Project-Id-Version: transtestn" "Report-Msgid-Bugs-To: n" "POT-Creation-Date: 2011-05-24 22:47+0100n" "PO-Revision-Date: 2011-05-30 23:03+0100n" "Last-Translator: n" "Lan

Can C++ code be valid in both C++03 and C++11 but do different things?

C ++代码是否可以符合C ++ 03标准和C ++ 11标准,但根据编译的标准做不同的事情? The answer is a definite yes. On the plus side there is: Code that previously implicitly copied objects will now implicitly move them when possible. On the negative side, several examples are listed in the appendix C of the standard. Even though there are many more negative ones than positive, each one of them is

C ++代码可以在C ++ 03和C ++ 11中都有效,但做不同的事情吗?

C ++代码是否可以符合C ++ 03标准和C ++ 11标准,但根据编译的标准做不同的事情? 答案是肯定的。 好的一面是: 以前隐式复制对象的代码现在将在可能时隐式移动它们。 不利的一面是,标准附录C列出了几个例子。 即使有更多的消极因素而不是积极因素,它们中的每一个都不太可能发生。 字符串文字 #define u8 "abc" const char* s = u8"def"; // Previously "abcdef", now "def" 和 #define _x "there" "hello "_x // P