作者:fst123 | 来源:互联网 | 2023-05-17 10:21
--------------------Configuration:fs-Win32Debug--------------------Compilingfilesystem.c
--------------------Configuration: fs - Win32 Debug--------------------
Compiling...
filesystem.c
c:\复件 fs_dumper\filesystem.c(134) : warning C4018: '>' : signed/unsigned mismatch
Linking...
fs_dumper.obj : error LNK2001: unresolved external symbol "unsigned long __cdecl fs_read(struct file *,char *,int)" (?fs_read@@YAKPAUfile@@PADH@Z)
fs_dumper.obj : error LNK2001: unresolved external symbol _g_free
fs_dumper.obj : error LNK2001: unresolved external symbol "struct file * __cdecl fs_open(char const *)" (?fs_open@@YAPAUfile@@PBD@Z)
fs_dumper.obj : error LNK2001: unresolved external symbol _g_build_path
fs_dumper.obj : error LNK2001: unresolved external symbol "struct direntry * __cdecl fs_readdir(struct dir *)" (?fs_readdir@@YAPAUdirentry@@PAUdir@@@Z)
fs_dumper.obj : error LNK2001: unresolved external symbol "struct dir * __cdecl fs_opendir(char const *)" (?fs_opendir@@YAPAUdir@@PBD@Z)
fs_dumper.obj : error LNK2001: unresolved external symbol "void __cdecl deinit_fs(void)" (?deinit_fs@@YAXXZ)
fs_dumper.obj : error LNK2001: unresolved external symbol "struct path * __cdecl parse_path(char const *)" (?parse_path@@YAPAUpath@@PBD@Z)
fs_dumper.obj : error LNK2001: unresolved external symbol "int __cdecl init_fs(char const *)" (?init_fs@@YAHPBD@Z)
fs_dumper.obj : error LNK2001: unresolved external symbol _g_print
fs_dumper.obj : error LNK2001: unresolved external symbol _g_option_context_parse
fs_dumper.obj : error LNK2001: unresolved external symbol _g_option_context_add_main_entries
fs_dumper.obj : error LNK2001: unresolved external symbol _g_option_context_new
filesystem.obj : error LNK2001: unresolved external symbol _read_nand
filesystem.obj : error LNK2001: unresolved external symbol __imp__ntohl@4
filesystem.obj : error LNK2001: unresolved external symbol __imp__ntohs@4
Debug/fs.exe : fatal error LNK1120: 16 unresolved externals
执行 link.exe 时出错.
fs.exe - 1 error(s), 0 warning(s)
因为用到了include "glib.h"VC按照这种方法配置了gtk http://hi.baidu.com/loodi/blog/item/536bb7ee2dc8fa222cf53447.html
然后编译这个源代码出现这些错误
http://www.mediafire.com/?h1nhf53b165te6o
貌似mediafire被墙了。。怪不得源码很少有人下载
现在换成115网盘了http://u.115.com/file/bhi819wd
http://u.115.com/file/bhi819wd
这个压缩包里只有这5个文件
这个源文件里只有这几个文件:
filesystem.c
filesystem.h
nand.c
nand.h
fs_dumper.c
没有makefile。。自己不会写呀。。。
另外问下用MingW或者Cygwin需要写makefile么?
6 个解决方案
CFLAGS = -I.
OBJECT:filesystem.o nand.o fs_dumper.o
g++ $< -o $@
filesystem.o:filesystem.c filesystem.h
g++ -c $< $@ CFLAGS
nand.o : nand.c nand.h
g++ -c $< $@ CFLAGS
fs_dumper.o fs_dumper.c
g++ -c $< $@ CFLAGS
类似这样写吧. 自己可以根据情况修改.
修改下. 如果要生成静态库:
OBJECTS=filesystem.o nand.o fs_dumper.o
........
TARGET=xx.a
$TARGET:$OBJECTS
g++ $< -o $@
然后你的程序中加这个 .a编译就是了.
glib这个库文件所在路劲有没有加到linker的搜索路径里去?