Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: R1S8K on May 21, 2019, 08:06:03 pm
-
Hello,
I'm just starting my C++ debugging and programming, my main goal is to learn how to write classes and develop C++ libraries.
I know that codeblocks requires me to include the classes and libraries inside the project folder, but I want to link classes and libraries outside the project folder. How to do that?
===================================================
Edit1: I tried to include it with "Add files..." from the project tree, but didn't work.
... OK I wanted to include an image but didn't know how to ! Could anyone tell me how to include an image?
-
===================================================
Edit1: I tried to include it with "Add files..." from the project tree, but didn't work.
What "didn't work" mean? Error messages? Compiling problems?
please give more details about your error:
Also take this as help: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
... OK I wanted to include an image but didn't know how to ! Could anyone tell me how to include an image?
This is a extreme broad question:
1) Do you want to add an image to wxSmit?
2) Do you want to add an to a console application?
3) What file format has the image?
4) Are you using a library to load the image?
-
OK, now the attach image icons are available now :)
This is a extreme broad question:
1) Do you want to add an image to wxSmit?
2) Do you want to add an to a console application?
3) What file format has the image?
4) Are you using a library to load the image?
Yes, I just wanted to include an image here in my last post. Here it's:
What "didn't work" mean? Error messages? Compiling problems?
-
Also take this as help: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
-
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)
-
I tried that solution but I think I don't know what I'm doing.
I tried to add the main path for the project, but didn't work.
I did 2 things according to the link provided.
1. Add the main class libraries in the settings menu/compiler/Search directories/Compiler and Linker tabs I added the main path
2. Project/Build options/Search directories/Compiler and Linker tabs I added the main path
F:\computer_programming_dev\Programming_exercises\C++\classes\
This path contains:
1. 2 classes example folders
2. 1 main program folder
An this path contains the attached picture.
But the same problem, what I'm missing !
===================================================================================
BUT ! I actually developed those classes as simple new classes from File/New/Class
I thought that's it! That what it takes to develop a class library that can be used as #include "lib_ex.h" in projects. But when I search for them I actually don't find its library specific files like .a ... etc. They are just .cpp and .h files ! Does that consider these two files as library ?
I think I have to choose a complete new project library from the start as: static, dynamic or shared library. I think just developing a class that is .cpp or .h is what it takes for what I want!
So I want to develop a class library that can be included in a project, what should I choose of the three, static, dynamic or shared library?
-
Without: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
we can not help and will ignore all future post of you...
-
OK, I was able to solve the previous problem by developing a shared library in the main projects folder.
The main projects folder contains:
1. Application project folder.
2. Shared library example folder.
So I could include the new shared library, but when I tried to run the function from the shared library into the main project source file, I got an error saying
the code execution cannot proceed because .dll was not found
So I had to copy the shared library .dll file into the bin folder of the main project folder. And problem is solved.
My new question is:
How to include the .dll files in the main project bin folder automatically?
Now, if I've done anything new in the library, then I have to compile it and then copy the .dll file again into the bin of the main application folder.
-
Update2:
OK, I solved the problem of linking .dll files.
My question now is relatively general to how things work with code blocks. Now, what should I add to the main project in the build option every time I want to include a new library? Do I have to do the same procedure of adding the .a and .dll paths ?