User forums > Help

Project too big?? What can I do?

(1/1)

yasman:
Hello,

I'm trying to put my project into C::B.  It currently generates 1,515 object files.

Everything builds ok, but then I get a link error.  At first I thought I may be exceeding the 32k command line limit of LD (and I still may be).  I changed the setting so that it put the object files in a flat directory.  That didn't change my results.

If I delete 1 file, the link fails at xxx+1 (it gets 1 file further).

If I add 1 file to the project, the link fails at xxx-1 (one less file).

I think it has to do with the number of files being linked in.

Is there an easy way in C::B to break this project up, then link it too a single executable?

Thanks for any idea!

I attached a part of the Build log...




-------------- Build: all in pmi ---------------

g++  -o ./test xxx.o xxx.o xxx.o xxx.o xxx.o xxx.o xxx.o xxx.o xxx.o xxx.o xxx.o ....

/usr/bin/ld: ./xxx.o: No such file: Too many open files
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 7 seconds)
0 errors, 0 warnings
 

oBFusCATed:
There is a limit to the number of open files at once per process.
I think the default is 512.

Is there any reason you are not using libraries?
1500 files sound too much... another benefit will be that the link time will be reduced (if you use dll/shared lib)

yasman:
I guess I'm trying to understand how I can setup the library's in C::B under a single project?

Would the only way be to break it up into smaller projects?  I was just wondering the quickest way for me to get this large project to link.  I like being able to setup breakpoints anywhere in the project.

Thanks again,

oBFusCATed:
You could look at the Codeblocks.cbp.
It uses targets for separating the parts of the program

yasman:
I found my answer, thanks to everyone that posted!

I modified /etc/security/limits.conf file.  I added the following two lines:

*               soft    nofile          5000
*               hard    nofile          5000

Basically up'ed the max number of file descriptors for all users to 5000.

ulimit -n command displays the current max number of file descriptors for a single process.

Thanks again

Navigation

[0] Message Index

Go to full version