简体   繁体   中英

linking static library to my project without naming it (VS2010)

This is the project structure:

main.c
lib\example.lib
lib\example.h

main.c:

#include "lib\example.h"
int main(void){ return example(); }

example.h

int example(void);

example.lib contains an implementation as follows int example(void){return 4;}

if i open the projec properties and navigate to input i can add the dependency by naming the lib file.

$(ProjectDir)\lib\example.lib

Is there a way of adding all the files in the lib directory without naming them? All i can think of is editing the msbuild file to look for *.lib files and add them to the list before compiling. I wonder if there is a built in way of doing this.

在您的makefile中使用通配符,但是我认为这不是一个好习惯。

$(ProjectDir)\lib\*.lib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM