Csound Csound-dev Csound-tekno Search About

[Cs-dev] [off topic] strange compiling issues..

Date2008-01-24 15:17
FromRory Walsh
Subject[Cs-dev] [off topic] strange compiling issues..
I'm having some compiling issues that I can't seem to find a solution 
to. I have some C++ code that makes a copy of a binary file, appends a 
unique ID and string to the copy of the binary file and then checks the 
string by searching for the ID which is also a string and retrieves the 
text that follows. A bit of a mouth full but the idea is sound.

I'm building the code with scons along with some other applications that 
are part of the project. Here is the strange thing: If I set a new 
unique string to search for and compile the copy/append/read code on 
it's own it works fine, but if I then call scons to built all the 
project files including my copy/append/read code it doesn't work any 
more. If I then try to build it on its own again it still doesn't work. 
The only way to get it to work again is to change the string ID and 
compile it again on its own. I can post a stripped down example of my 
code if that helps. I've no idea what could be wrong? The only thin that 
scons does that I don't do when compiling is create and object file 
first. Could this have something to do with the problem?

Rory.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-24 15:54
FromJonatan Liljedahl
SubjectRe: [Cs-dev] [off topic] strange compiling issues..
Rory Walsh wrote:
> I'm having some compiling issues that I can't seem to find a solution 
> to. I have some C++ code that makes a copy of a binary file, appends a 
> unique ID and string to the copy of the binary file and then checks the 
> string by searching for the ID which is also a string and retrieves the 
> text that follows. A bit of a mouth full but the idea is sound.
> 
> I'm building the code with scons along with some other applications that 
> are part of the project. Here is the strange thing: If I set a new 
> unique string to search for and compile the copy/append/read code on 
> it's own it works fine, but if I then call scons to built all the 
> project files including my copy/append/read code it doesn't work any 
> more. If I then try to build it on its own again it still doesn't work. 
> The only way to get it to work again is to change the string ID and 
> compile it again on its own. I can post a stripped down example of my 
> code if that helps. I've no idea what could be wrong? The only thin that 
> scons does that I don't do when compiling is create and object file 
> first. Could this have something to do with the problem?

Probably, when you change the ID string (which I guess is hardcoded in
the source) it will recreate the object file. Instead of this you could
remove the .o files and keep the same ID. If that works then there's
something in the compiled output when building with scons that isn't the
same. It could be some flags to the compiler that makes it behave
differently. It could also be some bug in your code that only shows up
when linked differently or compiled with other flags. Look for wild
pointers and other memory bugs...

-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-01-24 16:11
FromRory Walsh
SubjectRe: [Cs-dev] [off topic] strange compiling issues..
Thanks Jonaten, it's definitely something do with the object files as if 
I leave scons out of it and do g++ -c test.cpp and g++ test.o -o 
test.cpp I get the same problems. Perhaps it's a memory bug, my code is 
pretty crude at the best of times...

Rory.


Jonatan Liljedahl wrote:
> Rory Walsh wrote:
>> I'm having some compiling issues that I can't seem to find a solution 
>> to. I have some C++ code that makes a copy of a binary file, appends a 
>> unique ID and string to the copy of the binary file and then checks the 
>> string by searching for the ID which is also a string and retrieves the 
>> text that follows. A bit of a mouth full but the idea is sound.
>>
>> I'm building the code with scons along with some other applications that 
>> are part of the project. Here is the strange thing: If I set a new 
>> unique string to search for and compile the copy/append/read code on 
>> it's own it works fine, but if I then call scons to built all the 
>> project files including my copy/append/read code it doesn't work any 
>> more. If I then try to build it on its own again it still doesn't work. 
>> The only way to get it to work again is to change the string ID and 
>> compile it again on its own. I can post a stripped down example of my 
>> code if that helps. I've no idea what could be wrong? The only thin that 
>> scons does that I don't do when compiling is create and object file 
>> first. Could this have something to do with the problem?
> 
> Probably, when you change the ID string (which I guess is hardcoded in
> the source) it will recreate the object file. Instead of this you could
> remove the .o files and keep the same ID. If that works then there's
> something in the compiled output when building with scons that isn't the
> same. It could be some flags to the compiler that makes it behave
> differently. It could also be some bug in your code that only shows up
> when linked differently or compiled with other flags. Look for wild
> pointers and other memory bugs...
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net