Menu

Can only run program through the IDE

bramsey
2008-10-06
2012-09-26
  • bramsey

    bramsey - 2008-10-06

    I have compiled and run my program successfull through the Dev C++ IDE. However if I try to run the .exe that is generated I get a error pop up stating, "The procedure entry point "blah blah" could not be located in the dynamic link libvray libvlc.dll. The libvlc.dll is what I'm trying to link to. I'm using my own make file show below.

    Project: test2

    Makefile created by Dev-C++ 4.9.9.2

    CPP = g++.exe
    CC = gcc.exe
    WINDRES = windres.exe
    RES =
    OBJ = main.o $(RES)
    LINKOBJ = main.o $(RES)
    LIBS = -L"C:/Dev-Cpp/lib" -L"./" -lvlc
    INCS = -I"C:/Dev-Cpp/include" -I"C:/../source/vlc-0.9.2/include"
    CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/../source/vlc-0.9.2/include"
    BIN = test2.exe
    CXXFLAGS = $(CXXINCS)
    CFLAGS = $(INCS)
    RM = rm -f

    .PHONY: all all-before all-after clean clean-custom

    all: all-before test2.exe all-after

    clean: clean-custom
    ${RM} $(OBJ) $(BIN)

    $(BIN): $(OBJ)
    $(CPP) $(LINKOBJ) -o "test2.exe" $(LIBS)

    main.o: main.cpp
    $(CPP) -c main.cpp -o main.o $(CXXFLAGS)

    I'm stumped becuase I don't understand why clicking compile/run in the IDE will execute the program fine but clicking the .exe results in several pop errors but then it runs fine.

     
    • cpns

      cpns - 2008-10-07

      thanks.

       
    • cpns

      cpns - 2008-10-06

      Where did you put the DLL file itself? Is there more than one different version of libvlc.dll on your system.

      The -lvlc linker option links the libvlc.a export library, not the DLL itself, that is linked at runtime by the OS. The OS will use the DLL in the same folder as the executable if there is one, and then search the paths specified in the PATH environment variable otherwise. Dev-C++ modifies the environment for its own purposed while running, so it is possible that the OS is resolving the link at runtime using different versions of the DLL.

      Start by checking the system for multiple copies of the DLL. Move the one you want to the application folder or eradicate the ones you don't need.

      Clifford

       
      • bramsey

        bramsey - 2008-10-07

        Thank you so much for the response. It did appear I had two versions of the DLL and I was linking to both of them. I removed the unnecessary link and linked only to the latest version and everything appears to be working correctly now. Thank you for your help that was exactly what my problem was.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.