Author Topic: Project too big?? What can I do?  (Read 3112 times)

Offline yasman

  • Single posting newcomer
  • *
  • Posts: 5
Project too big?? What can I do?
« on: September 16, 2009, 05:04:17 pm »
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
 

Online oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13161
    • Travis build status
Re: Project too big?? What can I do?
« Reply #1 on: September 16, 2009, 05:27:30 pm »
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)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline yasman

  • Single posting newcomer
  • *
  • Posts: 5
Re: Project too big?? What can I do?
« Reply #2 on: September 16, 2009, 05:58:47 pm »
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,

Online oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13161
    • Travis build status
Re: Project too big?? What can I do?
« Reply #3 on: September 16, 2009, 08:28:46 pm »
You could look at the Codeblocks.cbp.
It uses targets for separating the parts of the program
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline yasman

  • Single posting newcomer
  • *
  • Posts: 5
Re: Project too big?? What can I do?
« Reply #4 on: September 17, 2009, 02:31:47 am »
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