Author Topic: link only  (Read 3872 times)

Offline grahamo

  • Multiple posting newcomer
  • *
  • Posts: 17
link only
« on: April 19, 2011, 02:08:10 pm »
Hi,

I've had a look around and googled but cant see anything. Is it possible to do a "link only" with my final target. It depends on a lot of libs which have a custom build step. (its the corba IDL compiler).  I don't have the time to customise my IDL files so they automatically invoke the IDL compiler and generated my .cpp files, instead I've used a pre-build step which generates the .cpp files which are in turn compiler. Short story long, until I fix that up, my exe's dependencies are being built each time (at least those that depend on IDL files). I'll get to correcting that but in the meantime, I'd like to know if its possible to do a "link only" on my exe.

Secondly, can somebody confirm that setting a dependency in code blocks does NOT cause the IDE to automagically link against that lib.. as does Visual studio. I just need confirmation, thats all.

thanks and have a nice day

Graham

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: link only
« Reply #1 on: April 19, 2011, 04:59:04 pm »
Secondly, can somebody confirm that setting a dependency in code blocks does NOT cause the IDE to automagically link against that lib.. as does Visual studio. I just need confirmation, thats all.

I suggest turning on Full Compiler Logging to really know what CB Does.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

I do not believe either of the two types of Project Dependency in CB causes it to automatically link against a lib.

Type one (Workspace Project Dependency)  just causes the Project A to be built before Project B.
Type two (External Task/Project Dependency) Just cause Project A as being needed to be rebuilt is the External Dependency date-time is newer. Edit: I have never used this type so Not sure it works the way I said.

Note: Remember Code::Blocks is just an IDE not a compiler or Linker. If useing MSVC you can use the #pragma to do Library linkage if you still wish to do it that way.

Tim S
« Last Edit: April 19, 2011, 05:01:27 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: link only
« Reply #2 on: April 19, 2011, 05:10:21 pm »
Secondly, can somebody confirm that setting a dependency in code blocks does NOT cause the IDE to automagically link against that lib.. as does Visual studio. I just need confirmation, thats all.

That's correct, you have to add the libs you need to the "Link libraries" list yourself.

Offline grahamo

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: link only
« Reply #3 on: April 19, 2011, 06:07:49 pm »
Thanks a lot for those replies. I'm going to read up on that stuff.

The codeblocks team of developers have done an excellent job! I'm a little bit surprised how well its performing. 10/10!

have a nice day

G