User forums > General (but related to Code::Blocks)
select a host application to "run"
J4e8a16n:
Hi,
I red dozens of post on that matter and I am still lost. They talk about debuggers , C++ , etc.
Is Code Block an Ide? Are the examples not suppose to work by themselves?
I am learning C.
Here is my example I took on : http://melem.developpez.com/langagec/objc/
CodeBlock produces dsomme.o and exemple.o
--- Code: ---------- dsomme.c----
__declspec(dllexport) int somme(int a, int b)
{
return a + b;
}
__declspec(dllexport) int produit(int a, int b)
{
int prod = 0;
while (b-- > 0)
prod += a;
return prod;
}
---------------------------------
--------- exemple.c --------
#include <stdio.h>
__declspec(dllimport) int somme(int a, int b);
__declspec(dllimport) int produit(int a, int b);
int main(void)
{
int a = 2, b = 5;
printf("%d + %d = %d\n", a, b, somme(a, b));
printf("%d * %d = %d\n", a, b, produit(a, b));
return 0;
}
---------------------------------------
--- End code ---
Compiler is gnu gcc 4.4.5
-------
HP Pavilion Elite m9525f Desktop PC
Vista Édition Familiale Premium SP1 64 bits
Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
Intel 64 (EM64T), x86-64
------------
Thanks for your attention,
JPD
[attachment deleted by admin]
MortenMacFly:
--- Quote from: J4e8a16n on April 28, 2009, 03:10:53 pm ---Thanks for your attention,
--- End quote ---
Mind asking a question? What is your problem?!
J4e8a16n:
:o)
You seem to be in the same state has me when I red "select a host application to "run" ".
So. What does mean select a host application to "run" ?
JPD
MortenMacFly:
--- Quote from: J4e8a16n on April 28, 2009, 04:46:11 pm ---So. What does mean select a host application to "run" ?
--- End quote ---
It means that you cannot run a DLL as an application. It's a Dynamic Link Library. Libraries are loaded by a host application. Thus you need to run the host application to load/run the library functions.
As an example: You need to run codeblocks.exe to load the plugins (*.DLL's). For the plugin DLL's of Code::Blocks there is codeblocks.exe setup as "host application to run" therefore.
J4e8a16n:
exemple.c compiled as exemple.o has main function.
If it is compiled by code block can that be the host application?
Navigation
[0] Message Index
[#] Next page
Go to full version