Monday 15 August 2011

ide - Problems importing libraries to my c++ project, how to fix this? -



ide - Problems importing libraries to my c++ project, how to fix this? -

i'm using <xzy> ide compile program, , have problem import/integrate specific library it.

i error messages like

fatal error: 3rdpartylib.h: no such file or directory

for a

#include "3rdpartylib.h"

statement

ld.exe: cannot find `lib3rdparty.a`

for specifying

3rdparty

in additional libraries

at to the lowest degree got error message like

undefined reference `lib3rdparty::foo()'

what can prepare this?

it's mutual misconception, current ide used, responsible getting errors stated in question. see illustration

c++ lib in 2 same project ,one can work other can 't issue linking libxml++ , glib libraries codeblocks ide c++ windows ...

the problem never related used ide. in cases solution boils down, supply actual toolchain's compiler/linker appropriate path's search included headers, linked libraries.

one of major applicable answers linker related problems are

what undefined reference/unresolved external symbol error , how prepare it? undefined reference `winmain@16'

most of mutual ides provide features configure specific project. here samples

eclipse-cdt

include path settings:

library & library search path settings

visual studio 2013

code blocks

**dev c++ (bloodshed c++)

as faq:

9. how can utilize opengl library , others ?

all libraries comes mingw reside in lib directory. named in next way: lib*.a link library project, add together in project options, farther alternative files : -lopengl32 including libopengl32.a library. add together other library, follow same syntax: type -l (l in lowercase) plus base of operations name of library (filename without lib , .a extension).

you may consider putting -l alternative there add together directory pathes searched libraries.

qt creator

in order add together include paths have open .pro file , add together directories includepath variable. these paths separated spaces. reference can found here.

if none of above samples applies used ide/toolchain, hope you're able point of abstraction:

it's issue how provide compiling/linking options actual toolchain. ide used setup context minor point here.

c++ ide

No comments:

Post a Comment