Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1243 g++ parameters

OTHER
closed
nobody
gcc (462)
invalid
Behaves_as_Documented
2013-01-21
2009-01-21
Skarllot
No

I can:
g++ main.cpp `pkg-config --cflags --libs gtkmm-2.4`

But I can't:
g++ `pkg-config --cflags --libs gtkmm-2.4` main.cpp

This is frustating, because NetBeans use second one.

Discussion

  • Keith Marshall
    Keith Marshall
    2009-01-21

    Then this is a bug in NetBeans build system, so you need to report it to them.

    The second form of the command, as you've stated it, is definitively invalid; specifications for libraries *must* come *after* the source or object files which refer to them. Thus, putting the source file name at the end of the command is *always* wrong, if that source needs to resolve symbols from a library. Traditionally, the CFLAGS spec would be placed *before* the sources, so the definitively correct command format would be:

    $ g++ `pkg-config --cflags` main.cpp `pkg-config --libs gtkmm-2.4`

    This is *not* a MinGW bug.

     
  • Keith Marshall
    Keith Marshall
    2009-01-21

    • milestone: --> Behaves_as_Documented
    • status: open --> closed-invalid
     
  • Earnie Boyd
    Earnie Boyd
    2013-01-21

    • status: closed-invalid --> closed
    • resolution: --> invalid
    • category: --> Behaves_as_Documented
    • milestone: Behaves_as_Documented --> OTHER