Author Topic: GCC Make issues  (Read 396 times)

Offline straybit

  • Member
  • ***
  • Posts: 52
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
GCC Make issues
« on: August 28, 2020, 08:59:38 am »
I finally got something to work with make:  a static library named mylib.a that I placed in ~/bin/include
Spoiler (click here to view / hide)
[close]
Now, I'm building an application but make can't find mylib.a inspite of different ways of locating it
Spoiler (click here to view / hide)
[close]
I'm beginning to think that mylib isn't what I thought it was even though nm does list the contents.
I googled several sites to create this makefile but still don't understand everything that it is doing.  If anyone sees something wrong with my approach, I would greatly appreciate it being pointed out.

Thanks
Bruce

PS: And to make things more difficult, I can;t rebuild the file as ar says
Spoiler (click here to view / hide)
[close]
« Last Edit: August 30, 2020, 11:50:09 am by straybit »

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 2197
  • Karma: 458
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: GCC Make issues
« Reply #1 on: August 28, 2020, 03:35:50 pm »
I found this:
https://transang.me/library-path-in-gcc/

which suggests this might work
Code: [Select]
CPATH=~/bin/include
make
If not, try the full path to the directory.

Offline straybit

  • Member
  • ***
  • Posts: 52
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
Re: GCC Make issues
« Reply #2 on: August 29, 2020, 02:21:53 pm »
Thanks for your reply, murraymint.

It is not the include files that I'm seeing the difficulty.  GCC doesn't find mylib.a whether I use -l~/bin/lib and -lmylib.a or l~/bin/lib/mylib.a.  In both cases it says "I can't find 'mylib.a'.  (It is in that directory.)

Bruce

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 2197
  • Karma: 458
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: GCC Make issues
« Reply #3 on: August 30, 2020, 03:51:13 am »
What if you try the full path, ie without the tilde replacing part of it?

Offline straybit

  • Member
  • ***
  • Posts: 52
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
Re: GCC Make issues
« Reply #4 on: August 30, 2020, 11:47:24 am »
No change
Spoiler (click here to view / hide)
[close]
And just for reference, her is the makefile
Spoiler (click here to view / hide)
[close]

Bruce

Offline straybit

  • Member
  • ***
  • Posts: 52
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
Re: GCC Make issues
« Reply #5 on: August 30, 2020, 02:12:05 pm »
I believe that I have found why I'm having so many difficulties on the machine:
Spoiler (click here to view / hide)
[close]
I thought I had taken WinVista off this machine but it is still using about 55 GiB.  I'll clear that out and reinstall P10.
Bruce

Offline straybit

  • Member
  • ***
  • Posts: 52
  • Karma: 9
  • New To PeppermintOS
    • View Profile
    • Middleton Post 39
  • Peppermint version(s): 10
Re: GCC Make issues
« Reply #6 on: September 01, 2020, 02:06:19 pm »
OK!  I've reinstalled P10.  And many of the annoyances I was experiencing have vanished.  Yippee!
Unfortunately, it managed to make my 1tb external hard drive un-mountable.  I've installed thunar to mount newly attached drives.  For the 1tb, the icon just sits there spinning - even when I left it working over-night.  Same thing on another computer.  It did manage to mount a 16GB thumb-drive and I saved a few files that didn't get "saved" to 1tb.
Hopefully, my local PC repair shop will be open when I go by it and, maybe  :-\ , she can get it working again.
Until then, I'll have to try to reconstruct ALL of my data from memory  ???
Fortunately, I was able to retrieve the two makefiles from these messages.
Bruce