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

link shared library to ConsoleApp

(1/2) > >>

grim_asle:
Hi there,

this is another beginners-question...
how do i link a shared library (created with code::blocks as well) to my "console-application" ?
The error i get is "cannot find -lExamplelib.so"

I have set

build_options->linker-> linked libraries->libExamplelib.so ( that is indeed the full name of the Lib)
and I have deployed the path to this lib in the "search_directories".

The same worked with static linking, and i am confused by the linker, who is searching for another name than i provided in the settings.
Is this special and can someone tell me where to find general instructions how to link a shared library to my CA ?

Thanks so far,


ps: It does work invoking the compiler from my terminal with the corresponding options.

BlueHazzard:
have you set the right build target? On the left site of the build options. And it has to be activated near the build button...

grim_asle:
Do you mean the "debug or release" option ?
I have checked that ... and I can't find any other options and settings etc. on the left of the Build-option pane. Maybe i'm blind ...

BlueHazzard:
have you checked if on both is the same under search directories and libraries?
post the full biuild log from the build log tab

greetings

grim_asle:
Hi again,

this is it:


--- Code: ----------------- Build: Debug in gaslite_test ---------------

Linking console executable: bin/Debug/gaslite_test
/usr/bin/ld: cannot find -llibGASLITE_BWRS.so
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
 


--- End code ---

I guess it's not much, however.

greetings

Navigation

[0] Message Index

[#] Next page

Go to full version