正在摸索中,IDE:Code::Blocks 10.5,先是创建Dynamic Link Library,纠缠于一些参数,编译出来,但是最终在IIS里运行时显示内存错误,于是没办法,创建了个shared library,最终设置了一些参数后运行成功,同时搞明白了编译和链接的变量设置
1、菜单 - Settings - Compiler and debugger,编译器选择Borland C++ Compiler (5.5, 5.82),我使用的是BCC 5.5,toolchain executables 选项卡中,Compiler's installation directory选择安装路径,然后按Auto-detect按钮,检测不出,但是Program Files却识别出来,Debugger没有,因为同时安装了MinGW GCC 4.4,于是设置为gdb.exe为Debugger。
2、Search directories选项卡,设置好 BCC的INCLUDE和LIB目录。
3、Other settings选项卡,点击Advanced options按钮,会有个提示,不知道什么意思,看不懂英文,但是按确定继续,默认打开commands选项卡,command选择link object files to dynamic library,命令宏为:
$linker -q $libdirs -Tpd $link_options $link_objects,$exe_output,,$libs,,$link_resobjects
因为isapi需要引用个def文件,所以设置一个$def_input变量,将命令宏变为:
$linker -q $libdirs -Tpd $link_options $link_objects,$exe_output,,$libs,$def_input,$link_resobjects
设置完毕,一路OK到编辑窗口
4、菜单 - Project - Build options,Compiler settings选项卡 - Compiler Flags选项卡,选中.DLL executable [-tWD],

本文档介绍了如何在Code::Blocks 10.5中利用Borland C++ Compiler 5.5创建ISAPI扩展。通过调整IDE设置、编译器参数和链接库,成功解决IIS运行时的内存错误问题,并详细说明了每个步骤,包括设置编译器路径、包含目录、链接选项以及def文件的使用。
最低0.47元/天 解锁文章
2958

被折叠的 条评论
为什么被折叠?



