Peter Hwang
Peter Hwang

Reputation: 991

How to use opensource C library in Visual C++

I was trying to use a c library libwebsockets(https://github.com/warmcat/libwebsockets) for my c++ program. I followed the manual and it creates a visual studio solution and it works.

Since I am not used to develop a program on a windows 7 visual studio environment, I am not sure how library works. It looks like solution contains some test codes and core libraries.

In a windows7 environment, what is the best way to develop a C++ project using this this C library?

I am considering two ways which are:

  1. Add the c projects on the c++ project

  2. Add the c++ project on the c projects

Upvotes: 1

Views: 1544

Answers (2)

Alex D
Alex D

Reputation: 989

Use CMake utility to create VS project files out of make files.

Upvotes: 0

Mailerdaimon
Mailerdaimon

Reputation: 6080

Create two different Projects: One for the C lib and the other for your C++ Code. Then build the C Code into a *.lib File and add it to your C++ Project using this Answer: How to include libraries in Visual Studio 2012?

You can add both Projects into one Solution so they are easily accessible.

Upvotes: 2

Related Questions