User forums > Using Code::Blocks
Include dll into C++ project
gtafan:
--- Quote from: oBFusCATed on November 28, 2018, 04:30:49 pm ---His remark is related to the fact that some compilers (linkers to be exact) aren't able to link when a dll is given on the command line. They need special import libraries.
So his suggestion is useful, because if you have no idea about the capabilities of your compiler you're going to suffer a lot and you'll have to always ask for help at random forums and possibly be ignored.
If you're using a mingw based compiler and the dll is compatible with your compiler, just add the dll to the list of linked libraries, adjust the search paths and you should be able to link it.
If it doesn't work. Post full rebuild log, but first read compiler/linkers manual how it is supposed to work in your case.
Probably reading this first might help: http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_What_do_I_need_to_know_when_using_3rd_party_libs.3F
Also keep in mind that IDEs save time if you know what you're doing. If you expect to click buttons at random and get the result you're after - you'll be disappointed and you'll suffer a lot.
--- End quote ---
I have that default gcc compiler avaible with the last version of Code::Blocks, not shure about its exact name. As far I know it´s C dll I need to use.
So my question was more about exact steps I have to do in Code::Blocks, like select menu item x then a window apear, then select something there and so on.
oBFusCATed:
Have you read the FAQ item? Have you find the needed information there?
gtafan:
--- Quote from: oBFusCATed on November 29, 2018, 06:09:20 pm ---Have you read the FAQ item? Have you find the needed information there?
--- End quote ---
I have read the FAQ, but the information I need was not there.
oBFusCATed:
Are you sure?
What about these two:
--- Quote ---* In the linker settings (Project->Build Options->Search directories->Linker), point to the folder where you have your compiled library. A library usually ends with *.a or *.lib. Note that there are generally two types of libs: Static libs (after linking you are done) and Dynamic libs (where you link against an import lib but require another dynamic lib at runtime).
* In the linker settings (Project->Build Options->Linker settings) add the library/libraries you need to link against in the right order to the list of libs to link against. Order matters - again, dependencies must be taken into account. Inspect the developers guide of the component to know the dependencies. On Windows, this may include the MSDN, too which tells you what libraries you need to link against for certain symbols you or the library may make use of.
--- End quote ---
gtafan:
--- Quote from: oBFusCATed on November 30, 2018, 11:53:49 am ---Are you sure?
What about these two:
--- Quote ---* In the linker settings (Project->Build Options->Search directories->Linker), point to the folder where you have your compiled library. A library usually ends with *.a or *.lib. Note that there are generally two types of libs: Static libs (after linking you are done) and Dynamic libs (where you link against an import lib but require another dynamic lib at runtime).
* In the linker settings (Project->Build Options->Linker settings) add the library/libraries you need to link against in the right order to the list of libs to link against. Order matters - again, dependencies must be taken into account. Inspect the developers guide of the component to know the dependencies. On Windows, this may include the MSDN, too which tells you what libraries you need to link against for certain symbols you or the library may make use of.
--- End quote ---
--- End quote ---
Looks like I am blind, sorry my fault and thanks.
But 1 question I still have, didn´t I need to select where the .h file of the lib is?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version