LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-07-2009, 08:53 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 12

Rep: Reputation: 0
Cmake, linking libraries

Hi, here are the details of my problem. There is a project A I try to build, using the libraries of another project B. Both A and B will use boost.

Previously I use command line: gcc xx.c ... -L/path/B/lib/ -lB -ldl, which runs fine. Now I need to use cmake to compile A. How should I do it?

Old 04-08-2009, 06:13 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

With a "makefile", you use "make" syntax to generate a gcc command line.

With "CMake", you'll need to re-write your script to use "CMake" syntax instead.

The "gcc" and link syntax (the "gcc -o myprog -Lmylib" stuff: the final output) remains unchanged.

Here are some resources:

Good luck .. PSM


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking libraries. Gamma_User Linux - Newbie 1 01-19-2009 05:24 PM
linking X11 libraries samqazi1 Linux - Software 2 01-04-2006 01:14 AM
Linking old libraries to new one? winterhunter Linux - Software 7 10-24-2005 04:37 AM
Linking Libraries, Dependencies Killbot_5000 Linux - Software 4 09-28-2004 08:59 AM
Shared libraries and linking., devin Programming 3 04-08-2003 03:18 PM

All times are GMT -5. The time now is 10:10 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration