最近编写OpenGL程序,每次连接程序之前的时候总是要添加几个.lib文件。想问高手有没有办法不用每次手动添加,在VC加载的时候就自动加载可以吗?

解决方案 »

  1.   

    project->customWizard->选择配置好的工程,编译,就会生成一个Wizard了
      

  2.   

    使用这个指令试试:
    #pragma comment(lib, "yourlibfilename.lib")
      

  3.   

    #pragma comment(lib, "yourlibfilename.lib")
    还是这个好
      

  4.   

    我只是不知道#pragma comment(lib,"***.lib")是什么意思?可以说的详细点吗?各位大侠??
      

  5.   

    你把LIB放在你的程序目录里不行么
      

  6.   

    The following pragma causes the linker to search for the EMAPI.LIB library while linking. The linker searches first in the current working directory and then in the path specified in the LIB environment variable.#pragma comment( lib, "emapi" )
      

  7.   

    把lib加入到你的工程里,保存你的工程,下次打开的时候自然就有了
      

  8.   

    补充一点:
    The following pragma causes the linker to search for the EMAPI.LIB library while linking. The linker searches first in the current working directory and then in the path specified in the LIB environment variable.#pragma comment( lib, "emapi" )下面的预编译指令促使连接器在链接的时候搜索EMAPI.LIB库.链接器首先在当前工作目录下搜索,之后在LIB环境变量的指定的路径里搜索.
    #pragma comment( lib, "emapi" )
    一般在相应的头文件的开始部分,定义它.这与在工程LINK标签里设置是等价的.
      

  9.   

    把你lib的缺省路径设置到 VC->Tools->Option->Directories下面的lib路径里啊
    这样你每次编译的时候, 都会到缺省路径下去搜索的.
    当然, 你也得把你的lib文件加入到工程中去.