Johannes
Johannes

Reputation: 6707

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.

Upvotes: 1

Views: 35

Answers (1)

user1585121
user1585121

Reputation:

Use wildcards inside of your makefile, but I think it's not good practice.

$(ProjectDir)\lib\*.lib

Upvotes: 2

Related Questions