当前位置:编程学习 > wap >>

lib调用 奇葩的事情

请教大家个问题!有没有人遇到过,希望指教下!

在程序中调用一个a.lib,而a.lib调用b.lib!

现在的情况是

如果一个完整的a。lib库(不调用b。lib),在依赖项中,放着b.lib,程序运行不起来!,就是外围程序都运行部起来!

此时,b。lib根本就没调用,连a。lib也没调用! --------------------编程问答-------------------- 没遇到过,还是设置问题吧~~~ --------------------编程问答-------------------- 奇怪的问题,LZ可以看看TCPMP的例子。是动态的嵌套调用。 --------------------编程问答--------------------
引用 2 楼 bsr2009 的回复:
奇怪的问题,LZ可以看看TCPMP的例子。是动态的嵌套调用。



谢谢,我仔细看看! --------------------编程问答-------------------- 是不是签名的事情,让你的A加载不进来啊? --------------------编程问答-------------------- lib 是静态编译用的吧?应该不必设置依赖,加入到工程里就可以吧 --------------------编程问答--------------------
引用 4 楼 beyondma 的回复:
是不是签名的事情,让你的A加载不进来啊?


签名?什么意思? --------------------编程问答-------------------- 这个问题很具体没法帮你分析只能告诉你点注意事项。
1、在a.lib中只能包含b.lib的头文件引用不能包含b中的函数实现,因为静态链接库是把用到的函数包起来的,所以假如a.lib和b.lib中同时有一个函数实现会在连接期报错。
2、a.lib和b.lib的工程目标选项应该一致,比如你编译了b.lib用的是Debug|Windows Pocket PC 5.0,你的a.lib也应该是在Debug|Windows Pocket PC 5.0下编译的。
3、静态链接库a.lib和b.lib是分别编译的,你应该还有一个exe工程,这个工程应该同时引用a.lib和b.lib,因为你调用a.lib中函数的同时有可能需要用到b.lib的内容。


另外,我想知道楼主所说的“运行不起来”指的是什么。运行提示如果是红叹号“无法运行”,基本可以断定是我上面说的错误2.
--------------------编程问答-------------------- a与b库你说没有被调用,应该是根本就不会被链接进去,如果链接进去了就说明还是被调用了,出现这种情况还是库与宿主程序的编译选项不一致导致的。 --------------------编程问答-------------------- 目标都是ARM!

然后我用dumpbin看了下lib里面的信息
是这些!
File Type: LIBRARY

     Exports

       ordinal    name

                  x264_adaptive_quant
                  x264_adaptive_quant_frame
                  x264_analyse_free_costs
                  x264_analyse_init_costs
                  x264_cabac_context_init
                  x264_cabac_encode_bypass
                  x264_cabac_encode_decision_c
                  x264_cabac_encode_flush
                  x264_cabac_encode_init
                  x264_cabac_encode_terminal
                  x264_cabac_encode_ue_bypass
                  x264_cabac_entropy
                  x264_cabac_mb_skip
                  x264_cabac_range_lps
                  x264_cabac_renorm_shift
                  x264_cabac_transition
                  x264_coeff0_token
                  x264_coeff_token
                  x264_cpu_detect
                  x264_cpu_names
                  x264_cpu_num_processors
                  x264_cqm_delete
                  x264_cqm_init
                  x264_cqm_parse_file
                  x264_dct4_weight2_zigzag
                  x264_dct8_weight2_zigzag
                  x264_dct_init
                  x264_dct_init_weights
                  x264_deblock_init
                  x264_decimate_table4
                  x264_decimate_table8
                  x264_emms
                  x264_encoder_close
                  x264_encoder_delayed_frames
                  x264_encoder_encode
                  x264_encoder_headers
                  x264_encoder_open_76
                  x264_encoder_reconfig
                  x264_exp2_lut
                  x264_frame_cond_broadcast
                  x264_frame_cond_wait
                  x264_frame_copy_picture
                  x264_frame_deblock
                  x264_frame_deblock_row
                  x264_frame_delete
                  x264_frame_delete_list
                  x264_frame_expand_border
                  x264_frame_expand_border_filtered
                  x264_frame_expand_border_lowres
                  x264_frame_expand_border_mod16
                  x264_frame_filter
                  x264_frame_init_lowres
                  x264_frame_new
                  x264_frame_pop
                  x264_frame_pop_unused
                  x264_frame_push
                  x264_frame_push_unused
                  x264_frame_shift
                  x264_frame_sort
                  x264_frame_unshift
                  x264_free
                  x264_init_vlc_tables
                  x264_lambda2_tab
                  x264_lambda_tab
                  x264_level_token
                  x264_levels
                  x264_log
                  x264_log2_lut
                  x264_log2_lz_lut
                  x264_lookahead_delete
                  x264_lookahead_get_frames
                  x264_lookahead_init
                  x264_lookahead_is_empty
                  x264_lookahead_put_frame
                  x264_macroblock_analyse
                  x264_macroblock_bipred_init
                  x264_macroblock_cache_end
                  x264_macroblock_cache_init
                  x264_macroblock_cache_load
                  x264_macroblock_cache_save
                  x264_macroblock_encode
                  x264_macroblock_encode_p4x4
                  x264_macroblock_encode_p8x8
                  x264_macroblock_probe_skip
                  x264_macroblock_slice_init
                  x264_macroblock_tree_read
                  x264_macroblock_write_cabac
                  x264_macroblock_write_cavlc
                  x264_malloc
                  x264_mb_encode_8x8_chroma
                  x264_mb_encode_i4x4
                  x264_mb_encode_i8x8
                  x264_mb_load_mv_direct8x8
                  x264_mb_mc
                  x264_mb_mc_8x8
                  x264_mb_predict_mv
                  x264_mb_predict_mv_16x16
                  x264_mb_predict_mv_direct16x16
                  x264_mb_predict_mv_pskip
                  x264_mb_predict_mv_ref16x16
                  x264_mc_init
                  x264_mdate
                  x264_me_refine_bidir_rd
                  x264_me_refine_bidir_satd
                  x264_me_refine_qpel
                  x264_me_refine_qpel_rd
                  x264_me_search_ref
                  x264_nal_encode
                  x264_noise_reduction_update
                  x264_param2string
                  x264_param_default
                  x264_param_parse
                  x264_picture_alloc
                  x264_picture_clean
                  x264_pixel_init
                  x264_pixel_ssd_wxh
                  x264_pixel_ssim_wxh
                  x264_pps_init
                  x264_pps_write
                  x264_predict_16x16_init
                  x264_predict_4x4_init
                  x264_predict_8x8_init
                  x264_predict_8x8c_init
                  x264_predict_lossless_16x16
                  x264_predict_lossless_4x4
                  x264_predict_lossless_8x8
                  x264_predict_lossless_8x8_chroma
                  x264_prefetch_fenc
                  x264_quant_4x4_trellis
                  x264_quant_8x8_trellis
                  x264_quant_dc_trellis
                  x264_quant_init
                  x264_ratecontrol_delete
                  x264_ratecontrol_end
                  x264_ratecontrol_get_estimated_size
                  x264_ratecontrol_mb
                  x264_ratecontrol_new
                  x264_ratecontrol_qp
                  x264_ratecontrol_set_estimated_size
                  x264_ratecontrol_slice_type
                  x264_ratecontrol_start
                  x264_ratecontrol_summary
                  x264_rc_analyse_slice
                  x264_rd_cost_part
                  x264_rdo_init
                  x264_reduce_fraction
                  x264_run_before
                  x264_sei_version_write
                  x264_slicetype_analyse
                  x264_slicetype_decide
                  x264_slurp_file
                  x264_sps_init
                  x264_sps_write
                  x264_synch_frame_list_delete
                  x264_synch_frame_list_init
                  x264_synch_frame_list_push
                  x264_thread_sync_ratecontrol
                  x264_total_zeros
                  x264_total_zeros_dc
                  x264_validate_levels
                  x264_zigzag_init

  Summary

          CF .debug$S
          14 .idata$2
          14 .idata$3
           4 .idata$4
           4 .idata$5
          10 .idata$6

说实在,不明白什么意思?
看了下,其他的lib好像跟这个有点区别!
正常的,没有ordinary name这项,Summary很多!

求牛人指教下!

补充:移动开发 ,  Windows Phone
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,