User forums > Using Code::Blocks
Including DLLs in Code::Blocks projects
greentiger:
In the Project build options -> Linker settings -> Add (Link libraries), I find that I can add .a, .so. .lib, .dylib and .bundle files, but not .dlls.
However, compiling a project as a Shared Library genrates a .a, a .def and a .dll file. Now adding the .a file generates "function <> definition marked dllimport" errors from the library I'm trying to compile and use (ARIA). I've tried including the path of the DLL in the search directories also. This error persists.
How can I get a .so from Code::Blocks (on Windows) or include a DLL in a Code::Blocks project?
---
MORE INFO: I searched within this forum a little more intelligently, and found this thread http://forums.codeblocks.org/index.php/topic,10283.0.html to be very close to what I need. I am indeed getting a .a file, as I've already said: but even including it in the project using the library doesn't solve the problem. :(
greentiger:
Am I not clear in stating my problem or has no one used DLLs here? Please let me know if there's anything I need to clarify before you can help me.
ollydbg:
I can't get your idea... :( Can you give us steps to reproduce the problem?
greentiger:
There is this library called ARIA ( http://robots.mobilerobots.com/wiki/ARIA ), which I downloaded. They advice us to recompile instead of using the compiled version if we use a different compiler to compile the programs we write using the library functions. I have been able to successfully create (putting their source code in a "Shared library" project in Code::Blocks) a .so file, which I could include in my subsequent programs using the library. I did this because I have a more recent version of GCC than they've used when making their supplied .so file. I have been able to successfully compile and execute these programs too.
However, on Windows, choosing a "Shared library" project and putting in their source code creates a .dll, .a and a .def instead. I have successfully created these three files for the library's source code. However, as I create projects trying to use the Library, the (Project) Build options -> Linker settings -> Add button offers addition only for .a, .lib, .so, .dylib and .bundle files and not .dll files. Merely including the .a in my project and trying to compile it generates "function definition marked dllimport" errors for hundreds of functions in the library. These errors persist when I copy down the .dll in my project folder and in the bin\Debug folder. I've also tried adding the DLL's path in Build options -> Search directory".
stahta01:
I suggest you read the Library directions on build and using a DLL; sounds like you have defined something wrong either during the DLL Build or the application using the DLL.
Please turn on FULL Compiler Logging and ask the question with build log in the forum that supports building and using the library.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
NOTE: This web-site DOES NOT support that library.
Edit: I suggest using the same base version of GCC on windows, the latest 3.4.5 from MinGW, and see if their compiled DLL works right with a project. If it does, then likely you are building the DLL wrong.
Tim S.
Navigation
[0] Message Index
[#] Next page
Go to full version