User forums > General (but related to Code::Blocks)
Statically link libraries
geohei:
Hi.
I guess users of this forum are able to help:
http://stackoverflow.com/questions/41618835/mysql-library-error-on-different-hardware
I'd like to get rid of this error/warning ...
--- Code: ---./mybin: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18: no version information available (required by ./mybin)
--- End code ---
... by statically linking the libmysqlclient.so library. But following the linked postings didn't do anything!
Any ideas why?
Thanks,
stahta01:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
stahta01:
--- Quote from: geohei on January 25, 2017, 03:24:50 pm ---... by statically linking the libmysqlclient.so library. But following the linked postings didn't do anything!
--- End quote ---
FYI: You can NOT statically link an dynamic library; IIRC, the ".so" means dynamic library on Linux!
Please read the rules before you get banned http://forums.codeblocks.org/index.php/topic,9996.0.html
Tim S.
geohei:
Hi.
I read the rules at the registration process.
This posting was not about ...
1. a programming issue.
2. a compiler/linker error.
3. being too lazy to search Google or this forum.
I believed it was a Code::Blocks manipulation problem from my side, id est me making a mistake inside the Code::Blocks GUI in order to link a library. So I was asking for help in doing that, and not asking for general programming / compiler / linker help.
Sorry if what I tried was not possible, but I simply followed the stackoverflow article (I linked in OP), which didn't work for me.
--- Quote from: stahta01 on January 25, 2017, 07:33:34 pm ---FYI: You can NOT statically link an dynamic library; IIRC, the ".so" means dynamic library on Linux!
--- End quote ---
Thanks for the info!
BlueHazzard:
C::B per se has nothing to do with all this. Codeblocks invokes the compiler with the flags you provide. If you provide the flags for static linking or dynamic linking codeblocks will give them to to linker/compiler....
You question is WHAT flags do you need to make the compiler link this library statically. This kind of question are not allowed. You can ask WHERE you have to apply the linker flag "--static" in codeblocks...
Aside from this fussy formality...
To help you we always need the rebuild log as described here:
--- Quote from: stahta01 on January 25, 2017, 06:05:39 pm ---http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
--- End quote ---
You can't link a .so library: see http://stackoverflow.com/a/725550
So you need a static version of your library. I don't know where you can get that, probably you have to compile the library into a static library
If you have the static library you can replace your so file in the linker options with the static version...
greetings
Navigation
[0] Message Index
[#] Next page
Go to full version