如何构建一个库 [英] How to build a library

查看:155
本文介绍了如何构建一个库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何构建一个C ++库?我试图使用一个SDK(http://mac.softpedia.com/get/Development/Libraries/oscpack.shtml),但文件不包括任何.lib或.dll文件。我被告知我需要'建立我自己的库',但绝对没有线索这是什么意思!

How do I 'build a C++ library'? I am trying to use an SDK (http://mac.softpedia.com/get/Development/Libraries/oscpack.shtml) but the files don't include any .lib or .dll files. I'm told I need to just 'build my own library', but have absolutely no clue what this means!

推荐答案

不需要构建库。您只需将.cpp文件添加到您的编译命令。

You don't need to build a library. You can just add the .cpp files to your compile command.

g++ -o test main.cpp file1.cpp file2.cpp

这篇关于如何构建一个库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆