当我可以从终端编译时,在Linux和Eclipse中编译
Compiling in Linux&Eclipse when I can compile from terminal
所以我终于能够下载旧版本的webkit,并在终端中使用经典的编译它(在修复了100个错误之后)
./configure
make
现在,既然我有了程序的源代码,我的目标就是调试它(在C++代码和其他东西上设置断点)。由于我是第一次在这里使用Linux,所以我下载eclipse以获得直观的GUI。然而,当我导入项目时,我似乎无法编译它。Include错误无处不在,无论我怎么尝试都无法解决它们。
当我可以在终端中编译它时,我如何在eclipse中编译它?此外,是否有其他方法来调试程序?
非常感谢!
好的,所以我设法编译并链接了代码,这样它就可以用符号调试信息加载到gdb中,如下所示:
- 我下载并提取http://webkitgtk.org/releases/webkitgtk-2.0.4.tar.xz
- 我跑了/配置并手动执行
apt-get install
(或者在下载和编译ICU的情况下)所有所需的依赖关系 - 然后,我对
GNUmakefile
进行了以下修改,添加了-ggdb
到每个可用的global_cppflags
global_cflags
和global_cxxflags
(为了加快构建速度,我从cppflags中删除了所有警告标志,不确定它是否有区别。如果要针对此构建进行开发,可能应该恢复这些警告标志)
GNUmakefile
global_cppflags := -ggdb -fno-exceptions -DBUILDING_CAIRO__ -DBUILDING_GTK__
$(am__append_1) $(am__append_2)
#global_cppflags := -Wall -W -Wcast-align -Wchar-subscripts
# -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k
# -Wundef -Wmissing-format-attribute -Wpointer-arith
# -Wwrite-strings -Wno-unused-parameter -Wno-parentheses
# -fno-exceptions -DBUILDING_CAIRO__ -DBUILDING_GTK__
# $(am__append_1) $(am__append_2)
global_cflags := -ggdb
global_cxxflags := -ggdb -fno-rtti
然后,为了测试调试符号是否包含在编译器和链接器输出中,我运行了如下的gdb
~/dev/webkitgtk-2.0.4$ gdb ./Programs/MiniBrowser -d ./Tools/MiniBrowser/gtk/
GNU gdb (Ubuntu 7.8-1ubuntu4) 7.8.0.20141001-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./Programs/MiniBrowser...done.
(gdb) l
188 "WebKitSettings writable properties for default WebKitWebView",
189 "WebKitSettings properties",
190 webkitSettings,
191 NULL);
192 g_option_group_add_entries(webSettingsGroup, optionEntries);
193 g_free(optionEntries);
194
195 /* Option context takes ownership of the group. */
196 g_option_context_add_group(context, webSettingsGroup);
197
(gdb) l
198 return TRUE;
199 }
200
201 int main(int argc, char *argv[])
202 {
203 gtk_init(&argc, &argv);
204
205 GOptionContext *context = g_option_context_new(NULL);
206 g_option_context_add_main_entries(context, commandLineOptions, 0);
207 g_option_context_add_group(context, gtk_get_option_group(TRUE));
(gdb)
相关文章:
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- 如何在linux终端中同时编译和运行c++代码
- 在Linux for Windows上编译C++代码时出错
- 如何在 Mac 上正确编译C++,当它在 Linux 上编译没有问题时?
- 编译在我的 Mac 上工作,但在集群 (Linux) 上不起作用
- 在Linux上使用Clang / OLLVM交叉编译helloworld Windows可执行文件时的问题
- 在 Linux 中使用 -fvisibility=hidden 编译时出现库加载错误
- Steam 回调在 Linux / GCC 编译期间触发警告
- SFML 交叉编译 for Windows on Linux.
- 编译问题与 Ubuntu Linux
- 在Linux上交叉编译Windows应用程序时如何链接到Winsock?
- 在 Linux 上编译 - 在函数 '_start' 中:(.text+0x20):对 'main' 的未定义引用
- 在Linux/Ubuntu中编译openCV应用程序时,如何解决未定义的引用cv:..?
- Stringstream编译错误仅发生在linux环境中
- C++ 当我使用 iostream 时无法编译(Linux,CodeBlocks)
- 在Windows?上编译Linux OpenGL应用程序
- 在OS X上编译Linux应用程序 - 未找到标准库(CMATH)
- 交叉编译 linux-->windows:使用 opengl32 获得更新的 OpenGL 支持.dll
- 将未定义的引用交叉编译linux到windows
- 在没有运行库的情况下编译Linux下的c++