[CMake] getting undefined error to my own libs.

Aaron_Wright at selinc.com Aaron_Wright at selinc.com
Tue Dec 29 12:16:31 EST 2009


With templates it's easiest to declare and implement in one file. The 
compiler likes this. Anything else you try requires extra work. Unless 
you're working in an embedded environment I don't see how executable size 
should even be a concern.
---------------------------------------------------------
Aaron Wright



"eial at cs.bgu.ac.il" <eial at cs.bgu.ac.il> 
12/29/2009 09:11 AM

To
Aaron_Wright at selinc.com
cc
cmake at cmake.org
Subject
Re: [CMake] getting undefined error to my own libs.






I'm trying to refrain from using that because it can bloat up the 
executable size... unless you can tell me otherwise. in general the 
program will be compiled using g++ for now, maybe I'll add support for 
windows compiler later.
also, I'm trying to keep the definitions to the header files and the code 
to the src files.
On Tue 29 Dec 18:59 2009 Aaron_Wright at selinc.com wrote:
Just put the implementation of the template class in the declaration. Get 
that to work, then try to get fancy if you want to. 
---------------------------------------------------------
Aaron Wright 


"eial at cs.bgu.ac.il" <eial at cs.bgu.ac.il> 
Sent by: cmake-bounces at cmake.org 
12/29/2009 08:54 AM 


To
Eric Noulard <eric.noulard at gmail.com> 
cc
cmake at cmake.org 
Subject
Re: [CMake] getting undefined error to my own libs.







ok, I've read the links, let say I'm not use the export option, when I 
look at the how to avoid link errors here: 
http://www.parashift.com/c++-faq-lite/templates.html#faq-35.13 I see that 
what I've did is the same, isn't it? 
I'm not sure where to follow from here... if I've did what they say and I 
still get a undefined error, then I must have miss configured cmake.
when I add extern to the deceleration in the header, I get this error: 
storage class specified for `Array`

On Tue 29 Dec 17:16 2009 Eric Noulard wrote:
> 2009/12/29 eial at cs.bgu.ac.il <eial at cs.bgu.ac.il>:
> > hello Eric, thanks for the response.
> > I'd like to solve the Array issue first, then the boost because I have 
a feeling it is a different one because when I disable the relevant code 
it doesn't generates the error even when other parts of the program (such 
as the threadpool).
> > here are the array files content: http://codepad.org/klDWMowB
> 
> I assume the content of the .hpp is between #ifndef CARRAY_HPP
> then the code is the .cpp file.
> 
> The trouble comes from the fact that your class is a template one,
> so that the content of the .cpp file may not be compiled independently
> "as-is" because it must be instantiated first.
> 
> I invite you to read this:
> http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12
> and may be this one too:
> http://corfield.org/index.cfm/event/cplusplus.section/section/ptexp
> 
> Note that the "export keyword" solution may not be a good one
> because many compilers do not implement it, beginning with gcc:
> http://gcc.gnu.org/bugs/#nonbugs_cxx
> 
> > beside a strange typo that I've done, I don't thing I've miss 
configured it somehow.
> 
> I think may be you did not played a lot with templated classes.
> (just a guess I may be wrong).
> 
> Concerning this issue, I'm pretty sure this is not a CMake one.
> 
> -- 
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> 




_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091229/8e3adbe4/attachment.htm>


More information about the CMake mailing list