Hacker News new | ask | show | jobs
by jandrese 1963 days ago
Seems like he tried more complex examples too, but ran into roadblocks like a 2GB limit on executables and running into a commandline length limit restriction that dates back to early DOS days which made it impossible to link.

Both of those problems seemed solvable if he was willing to chunk up his application into libraries, maybe 1024 files per library then linked to the main application.

2 comments

I believe this is one of the reasons for object libraries (or archives, the foo.a files on linux/unix), you can then link in all of the object files from one of those at link time without having to list them all at once. That won't get past the 2GB limit on executables but it will get past the command line length.
This is correct, a .lib file on Windows has a bunch of .obj files in it that you can then link together.

You can also use command files[1] to pass options in instead of using the command line.

[1] https://docs.microsoft.com/en-us/cpp/build/reference/linking... to pass

I searched for an option for make to do a command line file like this but didn't see one so struck out.
I was going to suggest that, but he's running on Windows and I don't know if they are supported there. I guess they probably are since they're a compiler feature.
> a commandline length limit restriction that dates back to early DOS days which made it impossible to link.

MinGW's linker supports passing the list of objects as a file for this reason and CMake will use that by default.