您尚未登录。

#1 2014-03-29 17:13:25

otakuchiyan
宅醬
注册时间: 2014-03-02
帖子: 10
个人网站

關於 MENU_CACHE_* 宏

我已經確認過 menu-cache/menu-cache.h 已經被包含了,鏈接也是正確的。
問題就是 make 時找不到 MENU_CACHE_* 開頭的宏……
編譯命令是:ccache g++ -g -Wall `pkg-config --cflags --libs gtk+-2.0 libmenu-cache`
真是奇怪啊……

离线

#2 2014-03-29 18:29:26

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,384
个人网站

Re: 關於 MENU_CACHE_* 宏

贴可以重现问题的程序和完整的错误消息。

离线

#3 2014-03-29 21:17:26

otakuchiyan
宅醬
注册时间: 2014-03-02
帖子: 10
个人网站

Re: 關於 MENU_CACHE_* 宏

kiriha@Falcon ~/NanaseLauncher (git)-[master] % cat log
ccache g++ -g -Wall `pkg-config --cflags --libs gtk+-2.0 libmenu-cache` ./src/NanaseLauncher.cc
./src/NanaseLauncher.cc: 関数 ‘void ReloadMenu(MenuCache*, gpointer)’ 内:
./src/NanaseLauncher.cc:61:76: エラー: cannot convert ‘MenuCacheDir* {aka _MenuCacheDir*}’ to ‘MenuCache* {aka _MenuCache*}’ for argument ‘1’ to ‘MenuCache* menu_cache_ref(MenuCache*)’
     root_dir = (MenuCacheDir *)menu_cache_ref(menu_cache_get_root_dir(tree));
                                                                            ^
./src/NanaseLauncher.cc: 関数 ‘void GetMenuInfo()’ 内:
./src/NanaseLauncher.cc:71:86: エラー: ‘MENU_CACAE_ITEM’ was not declared in this scope
     root_dir = menu_cache_item_ref(MENU_CACAE_ITEM(menu_cache_get_root_dir(menu_tree)));
                                                                                      ^
./src/NanaseLauncher.cc: 関数 ‘void SetButton()’ 内:
./src/NanaseLauncher.cc:105:40: エラー: expected primary-expression before ‘;’ token
     static gfloat button_angle = 360 / ;
                                        ^
./src/NanaseLauncher.cc:107:60: エラー: ‘tan’ was not declared in this scope
     static gfloat button_to_point_offset = tan(button_angle);
                                                            ^
In file included from /usr/lib/glib-2.0/include/glibconfig.h:9:0,
                 from /usr/include/glib-2.0/glib/gtypes.h:34,
                 from /usr/include/glib-2.0/glib/galloca.h:34,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/glib-2.0/gobject/gbinding.h:30,
                 from /usr/include/glib-2.0/glib-object.h:25,
                 from /usr/include/glib-2.0/gio/gioenums.h:30,
                 from /usr/include/glib-2.0/gio/giotypes.h:30,
                 from /usr/include/glib-2.0/gio/gio.h:28,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from ./src/NanaseLauncher.cc:6:
./src/NanaseLauncher.cc:116:73: エラー: ‘MENU_CACAE_TYPE_DIR’ was not declared in this scope
         if(G_UNLIKELY(menu_cache_item_get_type((MenuCacheItem *)dir) != MENU_CACAE_TYPE_DIR)){
                                                                         ^
./src/NanaseLauncher.cc:120:9: エラー: ‘image’ was not declared in this scope
         image = gtk_image_new_from_icon_name(menu_cache_item_get_icon(MENU_CACAE_ITEM(dir)), GTK_ICON_SIZE_MENU);
         ^
./src/NanaseLauncher.cc:120:90: エラー: ‘MENU_CACAE_ITEM’ was not declared in this scope
         image = gtk_image_new_from_icon_name(menu_cache_item_get_icon(MENU_CACAE_ITEM(dir)), GTK_ICON_SIZE_MENU);
                                                                                          ^
./src/NanaseLauncher.cc:111:20: 警告: 使用されない変数 ‘images’ です [-Wunused-variable]
         GtkWidget *images;
                    ^
./src/NanaseLauncher.cc:113:15: 警告: 使用されない変数 ‘file’ です [-Wunused-variable]
         char *file;
               ^
./src/NanaseLauncher.cc:104:19: 警告: 使用されない変数 ‘button_size’ です [-Wunused-variable]
     static gshort button_size = 48;
                   ^
./src/NanaseLauncher.cc:106:19: 警告: 使用されない変数 ‘img_size’ です [-Wunused-variable]
     static gshort img_size = 26; 
                   ^
./src/NanaseLauncher.cc:107:19: 警告: 使用されない変数 ‘button_to_point_offset’ です [-Wunused-variable]
     static gfloat button_to_point_offset = tan(button_angle);
                   ^
./src/NanaseLauncher.cc: 関数 ‘gchar* GetConfigFile(const gchar*)’ 内:
./src/NanaseLauncher.cc:93:1: 警告: 制御が非 void 関数の終りに到達しました [-Wreturn-type]
}
^
./src/NanaseLauncher.cc: 大域スコープ:
./src/NanaseLauncher.cc:17:12: 警告: ‘reload_handler’ が定義されましたが使用されません [-Wunused-variable]
static int reload_handler = 0;
            ^
./src/NanaseLauncher.cc:21:17: 警告: ‘animation’ が定義されましたが使用されません [-Wunused-variable]
static gboolean animation = TRUE;
                 ^
./src/NanaseLauncher.cc:65:13: 警告: ‘void GetMenuInfo()’ が定義されましたが使用されません [-Wunused-function]
static void GetMenuInfo(){
             ^
./src/NanaseLauncher.cc:95:13: 警告: ‘void DrawRoll()’ が定義されましたが使用されません [-Wunused-function]
static void DrawRoll(){
             ^
./src/NanaseLauncher.cc:31:13: 警告: ‘void LaunchApp()’ が ‘static’ と宣言されましたが定義されていません [-Wunused-function]
static void LaunchApp();
             ^
makefile:5: recipe for target 'nanaselauncher' failed
make: *** [nanaselauncher] Error 1

就這麼多了。

程序在 https://github.com/otakuchiyan/NanaseLa … auncher.cc

最近编辑记录 otakuchiyan (2014-03-29 21:20:48)

离线

#4 2014-03-29 21:23:59

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,384
个人网站

Re: 關於 MENU_CACHE_* 宏

MENU_CACHE_ITEM
MENU_CACHE_TYPE_DIR

英文没学好哦~

那个 tan 函数要

#include<cmath>

还有一些语法和数据类型不对的问题,自己慢慢改吧。

还有,你这程序好像是 C 的?可为什么要用 C++ 的后缀啊……

最近编辑记录 依云 (2014-03-29 21:25:52)

离线

#5 2014-03-29 21:32:38

otakuchiyan
宅醬
注册时间: 2014-03-02
帖子: 10
个人网站

Re: 關於 MENU_CACHE_* 宏

百合仙子 说:

MENU_CACHE_ITEM
MENU_CACHE_TYPE_DIR

英文没学好哦~

那个 tan 函数要

#include<cmath>

还有一些语法和数据类型不对的问题,自己慢慢改吧。

还有,你这程序好像是 C 的?可为什么要用 C++ 的后缀啊……

只是想要一點 C++ 的特性。

离线

页脚