From: hs AT sbbs DOT se (Henrik) Newsgroups: comp.os.msdos.djgpp Subject: ld linker problems Date: Sun, 24 Nov 96 22:42:51 GMT Organization: Solace Computer Society, Sundsvall Lines: 31 Message-ID: <57afr7$4h5@fizban.solace.mh.se> NNTP-Posting-Host: ppp57.sbbs.se To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Hi everybody! ld isn't playing the way I want it to... Assume I compile these two files: ---------- file1.cc char silly_buffer[10000]; ---------- ---------- file2.cc int main(void) { } ---------- and link them together with 'gcc file1.cc file2.cc', it turns out that the 10000 bytes buffer is included in the final output file! Since the program (the start of which is defined to be main(), of course) doesn't reference it, I don't want it there! Obviously, ld is doing some kind of incremental linking here, and the only way of solving it is by making file1.o a library and including it with -l. Is there any better, or at least, any other way of doing this??? Any help will be much appreciated. Please mail a copy of your answer to hs AT sbbs DOT se Thanks in advance!!!! //HSe