User forums > Help
Two Projects in Workspace - problem with binding
(1/1)
FCM:
I tried two projects in one workspace
1st of console type with source
--- Code: ---#include <iostream>
using namespace std;
int addint(const int& x, const int& y);
int main()
{
cout << addint(10,20) << endl;
return 0;
}
--- End code ---
and 2nd of static lib type with source
--- Code: ---int addint(const int& x, const int& y)
{ return x+y; }
--- End code ---
and found that prototype of addint was not bound to its definition in static lib source.
Project dependencies was correct.
What else I have to do?
stahta01:
Link to your library.
Tim S.
oBFusCATed:
stahta01 was faster :)
Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
Then search the internet to understand what are static libraries and how to use them.
p.s. probably you need to add the static lib to your linker options ( project -> build options -> linker settings -> add )
FCM:
--- Quote from: oBFusCATed on June 21, 2010, 04:06:36 pm ---probably you need to add the static lib to your linker options ( project -> build options -> linker settings -> add )
--- End quote ---
Thanks very much!
--- Quote from: oBFusCATed on June 21, 2010, 04:06:36 pm ---Then search the internet to understand what are static libraries and how to use them.
--- End quote ---
What are static libraries I know.
I used to Visual Studio where no additional steps is needed, if static lib project is in the same Solution as the project in which it is used - and it is reasonable. ( In other cases very useful is directive #pragma comment(lib, "path_to_static_lib") - without any project properties tuning. )
oBFusCATed:
CB doesn't add the libs automatically at the moment, because it is hard to be implemented for all compilers CB supports.
Not sure if there is such pragma for gcc, but they are a bit ugly :)
Navigation
[0] Message Index
Go to full version