← Back to team overview

kicad-developers team mailing list archive

Re: Commit 0a829c328e90f550994a7660b310630a5aa02361 not compiling ("undefined reference to `PgmOrNull()'")

 

Le 05/10/2019 à 13:07, Ian McInerney a écrit :
> I am somewhat confused by the reason for needing to introduce the new
> function in that commit. Does this crash happen when running the Python
> from inside Pcbnew or when trying to run Pcbnew python bindings from the
> system Python prompt?

The crash happens  when trying to run Pcbnew python bindings from the
system Python prompt.

(You can try to runt the demo plot_board.py).

> 
> This seems to be treating a symptom in the Python code, specifically
> that there is no Pgm struct created for some reason. I would think this
> would actually cause issues in more functions than just the
> ComputeBoundingBox() function though, so this seems like it would be a
> fairly invasive fix to make across the code base.
> 
> 
> -Ian
> 

The Pgm struct is not created when running a python code outside Kicad.
(It is created when running Pcbnew from an application)

Currently, ComputeBoundingBox() is the only one function that calls
Pgm() without being running from Kicad.

Of course, Pgm() is called in a lot of places, but not in function that
can be called from a python script.

I will be happy to know a method not invasive (I tried to modify Pgm(),
but this is invasive).

A basic fix is to remove the call to Pgm() in ComputeBoundingBox()
because it fixes a very very minor issue, and creates a much more
annoying issue.

In fact one cannot call Pgm() in any function that can be called by a
python script from the Python prompt.


> On Sat, Oct 5, 2019 at 12:20 PM Dino Ghilardi <dino.ghilardi@xxxxxxxx
> <mailto:dino.ghilardi@xxxxxxxx>> wrote:
> 
>     Hello,
> 
>     Latest commit (master branch) is not compiling giving an
>     "undefined reference to `PgmOrNull()'" error during make
> 
>     I tried also using:
>     git clean-fx
>     make clean
>     cmake ../
>     make -j7
> 
>     may be something is missing from the commit?
> 
>     Platform: Debian Linux.
>     Commit 0a829c328e90f550994a7660b310630a5aa02361.
> 
>     Full error Message:
> 
>     ../../../common/libpcbcommon.a(class_board.cpp.o): In function
>     `BOARD::ComputeBoundingBox(bool) const':
>     class_board.cpp:(.text+0x1ec9): undefined reference to `PgmOrNull()'
>     class_board.cpp:(.text+0x1ed7): undefined reference to `PgmOrNull()'
>     ../../../common/libpcbcommon.a(class_board.cpp.o): In function
>     `BOARD::ComputeBoundingBox(bool) const [clone .constprop.440]':
>     class_board.cpp:(.text._ZNK5BOARD18ComputeBoundingBoxEb.constprop.440[_ZNK5BOARD14GetBoundingBoxEv]+0x2d6):
> 
>     undefined reference to `PgmOrNull()'
>     class_board.cpp:(.text._ZNK5BOARD18ComputeBoundingBoxEb.constprop.440[_ZNK5BOARD14GetBoundingBoxEv]+0x2e4):
> 
>     undefined reference to `PgmOrNull()'
>     collect2: error: ld returned 1 exit status
>     qa/gal/gal_pixel_alignment/CMakeFiles/test_gal_pixel_alignment.dir/build.make:328:
> 
>     recipe for target 'qa/gal/gal_pixel_alignment/test_gal_pixel_alignment'
>     failed
>     make[2]: *** [qa/gal/gal_pixel_alignment/test_gal_pixel_alignment]
>     Error 1
>     CMakeFiles/Makefile2:4060: recipe for target
>     'qa/gal/gal_pixel_alignment/CMakeFiles/test_gal_pixel_alignment.dir/all'
> 
>     failed
>     make[1]: ***
>     [qa/gal/gal_pixel_alignment/CMakeFiles/test_gal_pixel_alignment.dir/all]
> 
>     Error 2
>     Makefile:149: recipe for target 'all' failed
> 
> 
> 
>     Cheers, Dino
> 
>     _______________________________________________
>     Mailing list: https://launchpad.net/~kicad-developers
>     Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     Unsubscribe : https://launchpad.net/~kicad-developers
>     More help   : https://help.launchpad.net/ListHelp
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


-- 
Jean-Pierre CHARRAS


References