NO

Author Topic: Linker can't find lib files when linking static lib  (Read 3092 times)

gabor.dorka

  • Guest
Linker can't find lib files when linking static lib
« on: September 14, 2008, 05:32:11 PM »
Hi,

I donwloaded PellesC a couple of days ago and I started to work on a simple 2d game. So far I really like PellesC I think it is awesome :) I found a possible bug and some quirks, here is the list:

- I compiled zlib as a static lib in its own directory then I compiled libpng as a static lib. I wanted to link zlib into libpng but the linker couldn't find zlib.lib. I double-checked the library folder settings and the zlib folder is set properly. Then I compiled an exe and linked some libs from other directories and it worked fine. So it looks that library folder settings work only in some cases but not in every case. Finally I copied zlib.lib manually into libpng dir and the linker found it happily, so there is a workaround.

- I turned off 'always break on entry-point' in Tools/Options/Debug, but it doesn't work all the time. When I start the debugger and there is a breakpoint set somewhere then the debugger doesn't break on the entry-point but if there isn't a single breakpoint set then the debugger does break on entry-point.

- I tried to run pomake from command prompt with the same ppj file which I use in the IDE and it doesn't work. The compiler can't find standard includes, because the INCLUDE environment variable is not set properly. I modified the ppj file manually and used 'set' to log out all environment variables. When I compile from the IDE INCLUDE is set to C:\Program Files\PellesC\Include;... but when I compile from command line INCLUDE is set to $(PellesCDir)\Include;... I tried to set PellesCDir macro from command line (e.g. pomake /f project.ppj target PellesCDir="C:\Program Files\PellesC") and I also tried to call povars32.bat before calling pomake but nothing worked. I think I missed something obvious here, could you give me some advice?

- I use vim for text editing and the IDE always asks me if I want to reload externally modified files. After a while it gets really annoying and I couldn't find how to set file reload to automatic.

- Same story with Shift-F5, is it possible to get rid of the 'This will end the debugger' message box?

Thanks in advance,
Gabor Dorka

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Linker can't find lib files when linking static lib
« Reply #1 on: September 23, 2008, 06:43:49 PM »
- I compiled zlib as a static lib in its own directory then I compiled libpng as a static lib. I wanted to link zlib into libpng but the linker couldn't find zlib.lib. I double-checked the library folder settings and the zlib folder is set properly. Then I compiled an exe and linked some libs from other directories and it worked fine. So it looks that library folder settings work only in some cases but not in every case. Finally I copied zlib.lib manually into libpng dir and the linker found it happily, so there is a workaround.
A little vague, so hard to say what is going on or if there is indeed a problem for me to fix.

- I turned off 'always break on entry-point' in Tools/Options/Debug, but it doesn't work all the time. When I start the debugger and there is a breakpoint set somewhere then the debugger doesn't break on the entry-point but if there isn't a single breakpoint set then the debugger does break on entry-point.
When no breakpoints are set/active, and none of the "known" entry-point functions are found, the last and final default is to set a breakpoint at the entry-point anyway (right now, a Unicode entry-point like wmain is not known by the debugger, so this may trigger this behaviour).

- I tried to run pomake from command prompt with the same ppj file which I use in the IDE and it doesn't work. The compiler can't find standard includes, because the INCLUDE environment variable is not set properly. I modified the ppj file manually and used 'set' to log out all environment variables. When I compile from the IDE INCLUDE is set to C:\Program Files\PellesC\Include;... but when I compile from command line INCLUDE is set to $(PellesCDir)\Include;... I tried to set PellesCDir macro from command line (e.g. pomake /f project.ppj target PellesCDir="C:\Program Files\PellesC") and I also tried to call povars32.bat before calling pomake but nothing worked. I think I missed something obvious here, could you give me some advice?
The recommended way is to use POVARS32.BAT; it's designed to do what you want. Again, "it doesn't work" is a little vague, but did you specify the full path to the directory where Pelles C was installed? Something like: "\Program Files\PellesC\Bin\povars32". POVARS32 will set the PATH variable for Pelles C, so you can't find POVARS32 until the PATH is modified by ...mmm... POVARS32.

- I use vim for text editing and the IDE always asks me if I want to reload externally modified files. After a while it gets really annoying and I couldn't find how to set file reload to automatic.
This message can't be disabled right now; I should probably add a setting for this.

- Same story with Shift-F5, is it possible to get rid of the 'This will end the debugger' message box?
Same as above.
/Pelle