Hi OS4 fans,
I am trying to compile some unix commands. I changed the makefiles a little.
All was fine but during linking process, I had the error :
ld: final link failed: Invalid operation
I thought that the cause was a too long line. Yes, there are too many objects files.
I read docs from gcc and I saw that I could use ld scripts.
I created one (ld-script) with multiple lines of INPUT ( obj obj...).
When I compile with g++ -o prog ld-script, I had the error :
ld:ld-script: file format not recognized; treating as linker script
ld:ld-script:1: syntax error
I test this feature with a simple exec I coded and the compile worked.
I will add that I don't use -T because in this case, no input files are found.
I googled but I didn't find any hint to help me so I am here.
YesCop
Mon, 2012-01-23 14:54
#1
gcc, ld and script