User forums > General (but related to Code::Blocks)

static library [SOLVED]

<< < (3/5) > >>

sspecter:

--- Quote ---...if I remove the namespace "tools" completely it works fine. Maybe this helps...?!
--- End quote ---

Sadly, no.

I removed "using namespace tools;", but then C::B dont recognize any lib references (because im not using the namespace). Ive tried to substitute all references to library with "tools::reference" but then i get the same error as before (undefined references).

I didnt understood why it works for you, or why "using namespace tools" would give an error.

MortenMacFly:

--- Quote from: sspecter on February 27, 2006, 07:15:19 pm ---Sadly, no.

--- End quote ---
Yes, I tried! My project consistst of the library and the main. I guess you didn't also remove the namespace from the class (library). Remove this too and it'll work. You have to remove 4 (or were it 5?) lines of code.
Morten.

Michael:
Hello,

May be you forget to add a file/library to the include/link directory (see Projects-->Build options-->Directories-->Compiler/Link tab).

Best wishes,
Michael

sspecter:

--- Quote ---May be you forget to add a file/library to the include/link directory (see Projects-->Build options-->Directories-->Compiler/Link tab).

--- End quote ---

the lib is linked.

As i posted before, Then i dont include the header, C::B dont recognize the references ("identifier not declared" error). Then i dont link the library, i get "cannot find -lssptools" error. I am not getting any of these errors. I even tested to remove the header or the library just to see these errors.

Did I declared the library/header right?
If so, what can give "undefined reference" error, with the library and header included?
Is there anything to do to link a static library besides include the header and link the library?

Michael:
Hello,

Could you post your project (source files+project file(s)) in a 7z format (www.7zip.org)? I will give it a try this evening.

Best wishes,
Michael

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version