dynamic library compile order

Sysprogs forums Forums VisualGDB dynamic library compile order

This topic contains 1 reply, has 2 voices, and was last updated by  support 11 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #12988



    i set the shared dynamic library(libudev.so) via MS-Build property page.

    but after compile, there is an error with undefined reference to “udev_……..”

    visual gdb made the following makefile.

    (“test” is executable project and lib.a uses libudev)

    g++ -o Debug/test -Wl,-gc-sections    -Wl,–start-group Debug/test.o -ludev  -Wl,–rpath=’$ORIGIN’  /tmp/VisualGDB/d/PROJECT/MYLIB/VisualGDB/Debug/lib.a -Wl,–end-group

    there is in an error, and i changed library order via putty.

    g++ -o Debug/test -Wl,-gc-sections    -Wl,–start-group Debug/test.o -Wl,–rpath=’$ORIGIN’  /tmp/VisualGDB/d/PROJECT/MYLIB/VisualGDB/Debug/lib.a -Wl,–end-group -ludev 


    compile success.

    i have a question. i want to change library order via MSBuild property page.

    i want to set -ludev in last.

    please solve my problem.

    thank you.






    Normally the –start-group and –end-group arguments should handle this automatically – force the linker to automatically reorder the libraries between those 2 statements. Perhaps you are using some very old version of the linker that doesn’t handle it properly? If this is the case, simply updating it may solve the problem.

    If this doesn’t help, could you confirm that specifying -ludev just before –end-group still causes the problem?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.