User forums > Using Code::Blocks

Linking to a DLL

<< < (2/3) > >>

AndreasL:
Hi!

Sorry if it was not clear, all steps above was made in Code::Blocks.

I find information about how to add a DLL when writing make-file by hand for MinGW, but I thought that I would have some help in the Bode::Blocks GUI how to set up this.

The projects that I'm setting up, "Dynamic Link Library" and "Console application", are projects from the Code::Blocks "File -> New -> Project" window "New from Template", and what I'm trying to do is to link to projects created from Code::Blocks together, the DLL and the Console application.

BR,
Andreas

Ceniza:
Although you are using Code::Blocks for all of that, what you are trying to do has more to do with programming in general. If I get it right, what you want to do is to be able to use the DLL from the DLL example included in Code::Blocks in the Console application example also included with it. What you need to look for is how to use DLLs in your programs using C++. That is something you can do with Code::Blocks (actually, that the compiler, linker and OS can get to work) by writing the right code and setting everything up properly. Well, this is the wrong place to ask. Even if many people could help you with it, this forums are not used to solve general programming questions... and your questions seems to be just that.

In fewer words: we do not provide support for user applications that do not improve or extend in any way Code::Blocks itself.

stahta01:
If you really want to ask an Code::Blocks Question!!

Turn On full Compiler Logging
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Ask an question like on the command line I do "gcc -Xy" how to I enter the option -Xy in Code::Blocks.

Currently, you are posting like a person who has no idea what an Compiler or Linker is or do!!

Tim S.

AndreasL:
I found it.

You provide the import library (.a-file) under "Project Build Options" -> "Linker Settings" -> "Link Libraries".

I still think that this was a pure Code::Blocks question.

keeganator:
Hi AndreasL - glad you found your answer. I'm a newbie to Code::Blocks, but not to dev. I have the same requirement and came to the same conclusion that you did about adding my lib to the list of Link Libraries, but I'm still getting the "Undefined Reference" error when I try to call a global function in the lib. To set up my test, all I did was choose Static Lib from the project templates and a console app to call the functions. I prototyped the functions in a .h file which I included in my console project's main.cpp. Any thoughts?

Thanks very much,
Dan

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version