User forums > Using Code::Blocks
Shared lib question
stahta01:
Error message contain information useful to determine the cause of the problem.
Based on the little info you posted we must assume you are the problem!!
Without a build log or the real error message the best guess is you are the problem.
Please do not waste someone else's time by not posted the needed info.
If you wish to do that call a paid psychic help line.
We are NOT psychic to help you requires information that you need to provide!!
Edit: FYI, dynamic library means the same as shared library in nearly all cases. Static and Shared are NOT the same.
Linux tends to use the word shared while Windows uses DLL Dynamic Link Library http://en.wikipedia.org/wiki/Dynamic-link_library.
Tim S.
CarstenT:
stahta01,
sorry for being so much of an inconvenience, but I'll not try to reconstruct the error alone for getting a proper file-report. I don't know why you don't understand
quote
I've added an
#include <main>
in the consol test project. That made the function add(..) visible
unquote
to be a solution to my problem (that I cannot access the functions in the library.)
I got the solution before I got your response. As for the shared/dynamic .. why would the pop-up menu give me both choices if there are no difference?
take a break.
You really remind me why I don't frequent these forums anymore
oBFusCATed:
Sorry, but stahta01 is correct about the logs.
We need them, so we can get an idea what you are doing and what the real errors are!
The code you're pasting doesn't look like a valid c/c++, so how do you expect us to help you?
You've created a header file named main, without extension?
Why it is so hard for you to cooperate?
CarstenT:
hi oBFusCATed,
--- Quote ---Why it is so hard for you to cooperate?
--- End quote ---
I use this public pc outside my home to get on the net. My working-pc is at home. That does make communication somewhat slow and inconvenient as for just handing info over on request. The separation is a bliss for my general mood though.
My initial question is a bit unimportant since I've got something to work. I ought to have tried to gain more experience on the subject before asking in here. When I requested a 'shared library' I got something very much like this
--- Code: ---
// this dummy function /will/ be accessible in your new library
extern "C"
{
main()
{
int add( int a , int b )
{
return a + b ;
}
}
}
--- End code ---
After establishing a console project and linking to the library I could use 'add(..)' if I added
#include <main.h>
as any other directive I would use in a project.
And I bet you know the type of error-report you get if you take such a directive away, because we've all seen it so often.
I'm not kean on using
main
as the name of a library, but that's a minor inconvenience.
As for valid c/c++ it's much better than it used to be .. I've got 3-4000 pages to support me at home.
Code::Blocks is an impressive project
oBFusCATed:
Sorry, but I still don't think the snippet you've posted compiles without errors.
If you post code snippets from memory then for sure you're messing the little details and those are the really important ones.
Can you just use a flash drive, cd or even a floppy disk :) to transfer the files to the connected pc, so you can provide accurate information, so we can try to help you.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version