[Halld-offline] code compilation
David Lawrence
davidl at jlab.org
Fri Jan 20 11:50:07 EST 2012
Hi Beni,
I'm CC'ing this e-mail exchange to the offline list so everyone else
can know about it in case they are running into the same problem.
The reason hddm_s.cpp failed was because it included particleType.h
which has inline code that uses strcpy. I have added the string.h
include to particleType.h to address that issue.
The bcal2nt.cpp (and all of the recently added *.cpp programs in
the HDGeant directory) used exit() but didn't include stdlib.h. I
have added this include to all of those programs.
As you had pointed out, Ubuntu 11 uses a very new compiler (gcc 4.6?)
so thanks for being the canary in the coal mine and identifying these
issues now.
I committed these changes as revision 8734. If anyone has any
problem compiling these changes, let me know.
Regards,
-David
On 1/20/12 9:13 AM, Beni Zihlmann wrote:
>
> The first error I got in hddm_s++.cpp not having strcpy defined.
> after including #include <string.h> in hddm_s.hpp
> it compiled till HDGeant where bcal2nt.cpp chrashed not having
> "exit" defined upon which I included #include <stdlib.h> in
> hddm_s.hpp
>
> cheers,
> Beni
>
>
>> Hi Beni,
>>
>> Do you recall which program first gave the error? I'd like to see
>> if the hddm code is what needs the includes (in which case hddm_s.hpp
>> is the right place to add them) or if it is the program utilizing hddm.
>>
>> Regards,
>> -David
>>
>> On 1/20/12 9:05 AM, Beni Zihlmann wrote:
>>> Hi David,
>>> on my machine (ubuntu 10.10 )the code only compiles if I add
>>>
>>> #include <string.h>
>>> #include <stdlib.h>
>>>
>>> at the beginning of hddm_s.hpp in src/libraries/HDDM
>>>
>>> cheers,
>>> Beni
More information about the Halld-offline
mailing list