July 28, 2011

aureshinite aureshinite
Lab Rat
61 posts

QtCreator 2.2.1 don’t load DLLs

 

I am using QtCreator on Windows, and since I have switched from 2.0.1 to the 2.2.1 I have to setup my own libraries’ path to the executable path.

I have a subdir project structure, and in each library .pro file I have

  1. DESTDIR  = $$MY_LIB_DIR
  2. TARGET   = $$MY_LIB_NAME

In the main project, for each library I have

  1. win32{
  2.     win32-g++{
  3.  LIBS  += -L$$MY_LIB_DIR -l$${MY_LIB_NAME}
  4.     }
  5.     else{
  6. #MSVC
  7.     }
  8. }
  9. else{
  10.  LIBS  += -$$MY_LIB_DIR/lib -l$${MY_LIB_NAME}
  11. }

before I was able to launch the executable from QtCreator whatever was the value of MY_LIB_DIR (of course outside of QtCreator it need to be on the path), but now it just doesn’t launch. I need to set MY_LIB_DIR to the executable directory.

2 replies

July 28, 2011

Tobias Hunger Tobias Hunger
Mad Scientist
3224 posts

Is MY_LIB_DIR in your PATH? IIRC Windows checks the PATH for libraries to load.

July 28, 2011

Lukas Geyer Lukas Geyer
Dinosaur Breeder
2074 posts

You do. [goo.gl]

Windows then searches for the DLLs in the following sequence:

  • The directory where the executable module for the current process is located.
  • The current directory.
  • The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
  • The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
  • The directories listed in the PATH environment variable.

 
  ‹‹ [Solved]Manually building MySQL driver for newest SDK Download      accessing value of lineEdit in .cpp file- [SOLVED] ››

You must log in to post a reply. Not a member yet? Register here!