You are here

How to add my own .cc and .hh file

5 posts / 0 new
Last post
How to add my own .cc and .hh file

Hello,i use scons to complie.

Recently,I write some class in .cc and .hh files , when i #include<~path/name.hh>,i find that it did not compile .cc files. I have read sconstruct file but do not know how to add my own file to compile with.

Please give me some help

Post Situation: 
Sat, 2020-03-21 10:37

Header files need only be added to the accompanying source file.

Source (cc) files should be added to the scons settings files - the ones like "protocols.2.src.settings", etc, etc.  Probably you should try adding it to whichever scons setting file its neighbors in the directory already are in, or the highest numbered one available.  Notice that stuff in "higher" files cannot be linked against stuff in lower files.

Sat, 2020-03-21 12:41

Thank you smlewis.

I create a folder in /main/source/src and i write a myfoldername.src.setting ,but it seems do not work cause i get a error 

can not find lmyfoldername 

It means i need to make a library for my folder?

Sat, 2020-03-21 17:00

You CAN make a library for your folder.

You almost certainly SHOULD just add it to an existing library - it will take 1/100th of the time.

Let me suggest that the easiest thing to do will be to put it in main/source/src/protocols/myfoldername and then add it to protocols.8.src.settings.  That's what we teach new students to do for quick and dirty prototyping at the Rosetta Bootcamp.  IT's not a good permanent home for shared code but for something you are writing for yourself it's the fastest, easiest place to put it.

Sat, 2020-03-21 18:00

Thank you !

I put it in basic and it work(i do not know protocol map to which protocols.*.src.setting 1 h ago)

Sat, 2020-03-21 18:24