[Coin-discuss] Symphony and C++

Ted Ralphs tkralphs at lehigh.edu
Tue Jan 11 13:22:17 EST 2005


Michael Hennebry wrote:
> On Mon, 10 Jan 2005, Ted Ralphs wrote:
> 
> 
>>Michael Hennebry wrote:
> 
> 
>>>In a copy of Symphony's Template directory
>>>how do I add file user_problem.cc to its
>>>Master subdirectory and have the Makefiles
>>>still work?
>>>
>>
>>Currently, the Makefile does not automatically pick up files that do not
>>have either .c or .h extensions. In the near future, we will rewrite the
>>makefile to conform to the COIN standard and also allow it to pick up
>>files with other extensions. For the time being, the simplest solutions
>>are to either (1) confine everything to one of the existing files, or
>>(2) place new files in the provided directories and give them .c or .h
> 
> 
> Does that require editing a Makefile?
> If so, I think I found the place to do it,
> but if not, that would be better.

The makefiles are not really set up for what you are trying to do and 
have also admittedly beccome convoluted over the last 10 years of 
development. Currently, I believe you need to add the names of your 
source files to one of the lists in SYMPHONY/Template/Makefile. If you 
are just using the sequential version I would suggest adding it to the line

USER_MASTER_SRC   = user_main.c user_master.c

and sticking the file itself in the SYMPHONY/Template/Master directory.

I will try to work on some better Makefiles in the near future.

>>extensions. Putting C++ code into a file with a .c extension should not
>>cause any problems with the compiler in Linux or Unix.
> 
> 
> Thank you for the suggestion.
> Others reading this should remember that a .c file compiled as C++
> produces the same kind of object file as a .cc or .cpp file
> compiled as C++.
> It will have the same sort of name mangling and linkage requirements.
> Not hard to remember, but I know from experience that it can be
> frustrating if you don't.
> 


-- 
Dr. Ted Ralphs
Assistant Professor
Industrial and Systems Engineering
Lehigh University
(610)758-4784
tkralphs at lehigh.edu
www.lehigh.edu/~tkr2

"An optimist is someone who thinks
'It doesn't get any better than this.'
A pessimist is someone who's afraid that's true."



More information about the Coin-discuss mailing list