|
-
July 13th, 2006, 02:03 AM
#1
Linking with another executable
Hello
I am writing two executables, one being a unit test application of the other. The unit test has access to the headers of the first executable and I am looking for a way to use the functionalities.
Is there a way to statically link to another executable... Some linker option make it look like a library, perhaps.
I know that I can make a library from the first exectutable's code, but I'd prefer to save this step
Thanks for any help
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
July 13th, 2006, 02:27 AM
#2
Re: Linking with another executable
Are both executables .EXE programs ?
You can exports functions from .EXE just like the way DLL do, and your second application can use it (the exe which exported functions will be totaly used like DLL, it wont run separately.)
Regards,
Ramkrishna Pawar
-
July 13th, 2006, 02:51 AM
#3
Re: Linking with another executable
 Originally Posted by SeventhStar
Is there a way to statically link to another executable... Some linker option make it look like a library, perhaps.
NOPE.
-
July 13th, 2006, 03:49 AM
#4
Re: Linking with another executable
Statically linking to executable can be totaly equvivalent of including the source(of the exe which you want to treat like static library) in project.
Regards,
Ramkrishna Pawar
-
July 13th, 2006, 06:07 AM
#5
Re: Linking with another executable
Yes, but I didn't want to lose time in linking the same files again...
Guess I'll have to do it...
Thanks anyway
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
July 13th, 2006, 08:48 AM
#6
Re: Linking with another executable
You could use incremental linking. Linking's a fairly quick process though.
-
July 14th, 2006, 02:12 AM
#7
Re: Linking with another executable
 Originally Posted by GCDEF
Linking's a fairly quick process though.
Well it takes about 20 seconds for the linker to make an executable and about 14 seconds for the librarian to build the library.
I just wanted to skip these 14 seconds somehow...
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
July 14th, 2006, 02:16 AM
#8
Re: Linking with another executable
 Originally Posted by SeventhStar
Well it takes about 20 seconds for the linker to make an executable and about 14 seconds for the librarian to build the library.
Buy a new computer, or at least upgrade its physical memory.
-
July 14th, 2006, 02:35 AM
#9
Re: Linking with another executable
Well it's amd athlon 64 x2 dual core 3800+ (2 ghz), 2 gb ram, hdd hitachi sata2 7200rpm 8mb cache
Should I really?
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
July 14th, 2006, 02:43 AM
#10
Re: Linking with another executable
This is more than enough, I think the source code must be huge.....or you might not have Defragmented your hard disk in last 2 years.
Regards,
Ramkrishna Pawar
-
July 14th, 2006, 02:50 AM
#11
Re: Linking with another executable
 Originally Posted by SeventhStar
Well it's amd athlon 64 x2 dual core 3800+ (2 ghz), 2 gb ram, hdd hitachi sata2 7200rpm 8mb cache
Should I really?
Normally, not.
Well, my computer is just a poor Pentium 4 - 2.8 GHz, 1GB RAM and never faced such type of problems.
Who knows? Maybe exchanging them, I can help you to get rid of troubles.
-
July 14th, 2006, 02:52 AM
#12
Re: Linking with another executable
Yep... and with libraries like Boost, LuaBind and even the standard library, the compiler expands the template code to 6-7 times it's original size
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
July 14th, 2006, 03:06 AM
#13
Re: Linking with another executable
 Originally Posted by Krishnaa
or you might not have Defragmented your hard disk in last 2 years. 
AFAIK (but not quite sure) disk defragmenting for NTFS is just a funny waste of time.
Anyhow, I don't remember last time I did it. Usually I reinstalled OS more often than once at two years. And in that case the best disk defragmenter is "format". 
 Originally Posted by Krishnaa
This is more than enough, I think the source code must be huge.....
I remember some clever guys using a cool design tool. After few months of design work, they pushed "Generate Code" then "Build". The resulted 1GB executable made them real troubles, indeed.
-
July 14th, 2006, 03:12 AM
#14
Re: Linking with another executable
 Originally Posted by SeventhStar
Yep...
That's a reason for which those blamed guys from Microsoft invented DLLs for us.
-
July 14th, 2006, 04:20 AM
#15
Re: Linking with another executable
 Originally Posted by SeventhStar
Well it takes about 20 seconds for the linker to make an executable and about 14 seconds for the librarian to build the library.
I just wanted to skip these 14 seconds somehow...
Forgive me, no offence, but...
If you want skip them then skip them. The possible ways for skipping (in order of preference):- Think 14 seconds about your girl/wife, look at her photo.
- Take a couple sips of espresso/coke.
- Look at the window/aquarium/magazine cover
- Think about your code deciding how to improve its design and eliminate its frequent re-building
Now, been gravely serious... Man, are you kidding? Do you really cannot stand 14 seconds of build? Or even 34? Then choose the last variant.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|