本来打算今天在学校写论文的,昨天同事相约去爬崂山都没有去,但是昨天晚上在外面吃饺子的时候,
遇到了一小哥,说昨天去家乐福示威游行了,遂决定今天也去,还给那小哥付了饺子钱。
今天,一早去了,跟着游行的队伍喊了一上午。中午休息了一会儿,下午又一直到5点。
期间有很多事,有好也有坏,没力气再作评论。以后再说吧!
2008年4月19日星期六
2008年4月13日星期日
demo
想把每件事都做得尽量完美,思索好的想法,写了好多demo,想把每个想法都写出demo来,
但是时间有限,还有更重要的事要做。已经没有了时间仔细的研究某个算法,只是在做
应用,想法->接口->应用->算法,算法才是真正核心的东西,是内功心法,但是已没有时间
心情去研究,思考,以后的工作也是主要做应用了。
这几周发生了好多事,很多以前未曾想过的事,但确实发生了,可能我长大了吧。也许吧!
有些事还不知道去怎么处理,有时候想对得起自己又对得起别人是很难的事情,也许是不可能的吧。
不想那么多了,随着心灵的方向吧。
盲评没有被抽着,挺爽!但五月中旬总是要交论文的,程序准备不再写了,虽然自己确实很
想写,还有很多自己的想法没有做成demo,但已经是做得比较好了。准备赶快写完论文做完实验,
剩下的就是把赶快培养起师弟,和做公司的项目。公司的项目难度不是很大,但需要耗时间,慢慢
来吧。
说好的请双吃饭,快两个月了,还没有实现,真是惭愧啊!
2008年4月6日星期日
2008年4月1日星期二
How can an MSVC program call a MinGW DLL, and vice versa?
from : http://www.mingw.org/mingwfaq.shtml
Assume we have a testdll.h, testdll.c, and testmain.c. In the first case, we will compile testdll.c with MinGW, and let the MSVC-compiled testmain call it. You should use
gcc -shared -o testdll.dll testdll.c \
-Wl,--output-def,testdll.def,--out-implib,libtestdll.a to produce the DLL and DEF files. MSVC cannot use the MinGW library, but since you have already the DEF file you may easily produce one by the Microsoft LIB tool: lib /machine:i386 /def:testdll.def
Once you have testdll.lib, it is trivial to produce the executable with MSVC:
cl testmain.c testdll.lib Now for MinGW programs calling an MSVC DLL. We have two methods. One way is to specify the LIB files directly on the command line after the main program. For example, after
cl /LD testdll.c use gcc -o testmain testmain.c testdll.lib
The other way is to produce the .a files for GCC. For __cdecl functions (in most cases), it is simple: you only need to apply the reimp tool from Anders Norlander (since his web site is no longer available, you may choose to download here a version enhanced by Jose Fonseca):
reimp testdll.libgcc -o testmain testmain.c -L. -ltestdll However, for __stdcall functions, the above method does not work. For MSVC will prefix an underscore to __stdcall functions while MinGW will not. The right way is to produce the DEF file using the pexports tool included in the mingw-utils package and filter off the first underscore by sed:
pexports testdll.dll | sed "s/^_//" > testdll.def Then, when using dlltool to produce the import library, add `-U' to the command line:
dlltool -U -d testdll.def -l libtestdll.a And now, you can proceed in the usual way:
gcc -o testmain testmain.c -L. -ltestdll Hooray, we got it.