Author Topic: The library search path is not included in the PATH in the compilergcc plugin  (Read 3049 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6092
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Hi, I just build C::B trunk yesterday, and I found that if I link to a dll file directly, and the dll file is in the library search path. The old C::B can run the executable. But the latest failed, because it said the exe can't find the dll file.

Which means the PATH is not including the library search path?

I looked at the change history of the compiler gcc folder, and still not sure which commit cause this issue. The old C::B I'm using is built from 2025-02.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1769
I would bet r13731 (Running compiled program fails because of wrong PATH) is related.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6092
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I would bet r13731 (Running compiled program fails because of wrong PATH) is related.

Thanks.

Yes, I think this is related.

Especially here:

Code
@@ -1445,8 +1453,10 @@ int CompilerGCC::DoRunQueue()
     else
         m_timerIdleWakeUp.Start(100);
 
-    // restore dynamic linker path
+    // restore old dynamic linker path
     wxSetEnv(CB_LIBRARY_ENVVAR, oldLibPath);
+    // restore old PATH environment
+    wxSetEnv("PATH", oldPath);
 
     delete cmd;
     return DoRunQueue();

The old "PATH" get restored.

I think when we click the "run" button on the toolbar, we should also set the PATH, and when run finished, we should restore the PATH.

Hi, Morten, can you have a look?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.