1

In compiling a DLL, I've been running into a lot of undefined reference errors, which I think may be caused by circular dependencies between libraries. To fix this, I've been trying to use the -( archives -) and --start-group archives --end-group options:

gcc -Wall -shared Pipeline.cpp -I"C:/Python38/include" -I"C:/Program Files/Pleora Technologies Inc/eBUS SDK/Includes" -I "C:/Python38/Lib/site-packages/numpy/core/include" -L"C:\Users\fmkz78\AppData\Local\Continuum\anaconda3\libs" -L"C:/Program Files/Pleora Technologies Inc/eBUS SDK/Libraries" -o lib.dll -( -lEbInstallerLib64 -lEbTransportLayerLib64 -lEbUtilsLib64 -lPtConvertersLib64 -lPtUtilsLib64 -lPvAppUtils64 -lPvBase64 -lPvBuffer64 -lPvCameraBridge64 -lPvDevice64 -lPvDSSource64 -lPvGenICam64 -lPvGUI64_VC10 -lPvGUI64_VC11 -lPvGUI64_VC12 -lPvGUI64_VC14 -lPvPersistence64 -lPvSerial64 -lPvStream64 -lPvSystem64 -lPvTransmitter64 -lPvVirtualDevice64 -lSimpleImagingLib64 -lpython37 -)

Doing this results in the error gcc: error: unrecognized cpmmand line option '-(' and again for the closing option. I get the same problem using the start and end group options. I'm running on Windows 10 using the MinGW gcc compiler.

Am I using them in the wrong place, or is there a problem in my setup?

Chris-G
  • 33
  • 4

1 Answers1

0

--start-group and --end-group (and the short forms, -( and -)) are linker options.

You'll need -Wl to use them from the compiler driver gcc, so that it passes them through to the linker rather than trying to understand them itself (which it can't, because it doesn't have any such switches).

So:

-Wl,--start-group
-Wl,--end-group
-Wl,-(
-Wl,-)

are fine.

But these:

--start-group
--end-group
-(
-)

are not.

By the way, you probably want g++, not gcc, unless you're deliberately skipping the C++ standard library (and other relevant runtimes) from your build.

Asteroids With Wings
  • 17,071
  • 2
  • 21
  • 35