[RESOLVED] Error when using library October 14, 2009 12:02PM | Registered: 14 years ago Posts: 161 |
#--------------------------------------------------------------------------------- %.a: @echo linking to lib ... $(notdir $@) @$(AR) -rc $@ $^ # and i've changed the output with this #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- $(OUTPUT).a: $(OFILES)
Re: Error when using library October 14, 2009 03:26PM | Registered: 14 years ago Posts: 265 |
Re: Error when using library October 14, 2009 05:03PM | Admin Registered: 14 years ago Posts: 5,132 |
Re: Error when using library October 14, 2009 05:32PM | Registered: 14 years ago Posts: 161 |
Quote
Arikado
Sounds like you're not properly linking your library into projects that use it.
It depends :) Sometime many instance of a class are not well instanciated (instead, all instance are one. for exemple, if i create three counter, all counter will be at the same memory space....). Other time, the stack is corrupted or my object attribute values randomly change ?!!! So, i can say that it's a random effect.Quote
Arikado
Sounds like you're not properly linking your library into projects that use it.
Re: Error when using library October 14, 2009 06:21PM | Admin Registered: 14 years ago Posts: 5,132 |
Just several quick pointers:Quote
arasiumQuote
Arikado
Sounds like you're not properly linking your library into projects that use it.
Yes, i was thinking about something like that. For the linker, i use the default devkitpro options. Should i add an other one?
Re: Error when using library October 15, 2009 10:20AM | Registered: 14 years ago Posts: 161 |
Quote
ArikadoJust several quick pointers:Quote
arasiumQuote
Arikado
Sounds like you're not properly linking your library into projects that use it.
Yes, i was thinking about something like that. For the linker, i use the default devkitpro options. Should i add an other one?
1) Make sure that your lib is named libwhatever.a - You must have the first three characters named lib for it to be recogonized by devkitPPC compile
2) Make sure that your library is stored in the correct libs directory with the rest of your devkitPPC libraries (c:/devkitPRO/devkitPPC/libs -- Or something like that is the proper path)
3) In your makefile for your project using your library, link it in under LIBS: using "-l" in place of "lib" EX:
-lsomething
4) In your project's C/C++ files using your lib, make sure you properly #include it.
Good luck!!!
Re: Error when using library October 15, 2009 04:12PM | Registered: 13 years ago Posts: 379 |
Re: Error when using library October 15, 2009 04:55PM | Admin Registered: 14 years ago Posts: 5,132 |
Re: Error when using library October 16, 2009 11:10AM | Registered: 14 years ago Posts: 161 |
class A { private: int test; public: void Do(); }
class A { public: void Do(); }
int main() { A a; a.Do(); }
Re: Error when using library October 18, 2009 12:25AM | Registered: 14 years ago Posts: 265 |