wxDev-C++ 6.10: can't compile DLL's Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
alocin
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Nov 02, 2006 12:33 pm

wxDev-C++ 6.10: can't compile DLL's

Post by alocin » Thu Nov 02, 2006 12:56 pm

Hi,

I have just installed the new 6.10 beta version, and I have tried to create and compile a new DLL. I have just opened a new project, selected DLL, and compiled the project skeleton as created by wxDev-C++.
With the previous 6.8 version I have no problem, but now the compiler show this error message:

C:\aijen\CT\NuovoCompil\Makefile.win [Build Error] exe: *** [MingW/Progetto1.dll] Error 1

The entire compiler log is this one:
Compilatore: Default GCC compiler
Building Makefile: "C:\aijen\CT\NuovoCompil\Makefile.win"
Esecuzione di make clean
rm -f MingW/dllmain.o MingW/Progetto1.dll

g++.exe -c dllmain.cpp -o MingW/dllmain.o -I"C:/Programmi/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Programmi/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Programmi/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Programmi/Dev-Cpp/include/c++/3.4.2" -I"C:/Programmi/Dev-Cpp/include" -I"C:/Programmi/Dev-Cpp/" -I"C:/Programmi/Dev-Cpp/include/common/wx/msw" -I"C:/Programmi/Dev-Cpp/include/common/wx/generic" -I"C:/Programmi/Dev-Cpp/include/common/wx/fl" -I"C:/Programmi/Dev-Cpp/include/common/wx/gizmos" -I"C:/Programmi/Dev-Cpp/include/common/wx/html" -I"C:/Programmi/Dev-Cpp/include/common/wx/mmedia" -I"C:/Programmi/Dev-Cpp/include/common/wx/net" -I"C:/Programmi/Dev-Cpp/include/common/wx/ogl" -I"C:/Programmi/Dev-Cpp/include/common/wx/plot" -I"C:/Programmi/Dev-Cpp/include/common/wx/protocol" -I"C:/Programmi/Dev-Cpp/include/common/wx/stc" -I"C:/Programmi/Dev-Cpp/include/common/wx/svg" -I"C:/Programmi/Dev-Cpp/include/common/wx/xml" -I"C:/Programmi/Dev-Cpp/include/common/wx/xrc" -I"C:/Programmi/Dev-Cpp/include/common/wx" -I"C:/Programmi/Dev-Cpp/include/common" -I"C:/Programmi/Dev-Cpp/include" -DBUILDING_DLL=1

g++.exe --out-implib "libMingW/Progetto1.a" -o MingW/Progetto1.dll MingW/dllmain.o -L"C:/Programmi/Dev-Cpp/Lib" --no-export-all-symbols --add-stdcall-alias

g++.exe: libMingW/Progetto1.a: No such file or directory

mingw32-make.exe: *** [MingW/Progetto1.dll] Error 1

Esecuzione terminata

And this is the Makefile.win:
# Project: Progetto1
# Compiler: Default GCC compiler
# Compiler Type: MingW 3
# Makefile created by wxDev-C++ 6.10 on 02.11.06 13:41

CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = MingW/dllmain.o
LINKOBJ = MingW/dllmain.o
LIBS = -L"C:/Programmi/Dev-Cpp/Lib" --no-export-all-symbols --add-stdcall-alias
INCS = -I"C:/Programmi/Dev-Cpp/Include" -I"C:/Programmi/Dev-Cpp/include"
CXXINCS = -I"C:/Programmi/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Programmi/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Programmi/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Programmi/Dev-Cpp/include/c++/3.4.2" -I"C:/Programmi/Dev-Cpp/include" -I"C:/Programmi/Dev-Cpp/" -I"C:/Programmi/Dev-Cpp/include/common/wx/msw" -I"C:/Programmi/Dev-Cpp/include/common/wx/generic" -I"C:/Programmi/Dev-Cpp/include/common/wx/fl" -I"C:/Programmi/Dev-Cpp/include/common/wx/gizmos" -I"C:/Programmi/Dev-Cpp/include/common/wx/html" -I"C:/Programmi/Dev-Cpp/include/common/wx/mmedia" -I"C:/Programmi/Dev-Cpp/include/common/wx/net" -I"C:/Programmi/Dev-Cpp/include/common/wx/ogl" -I"C:/Programmi/Dev-Cpp/include/common/wx/plot" -I"C:/Programmi/Dev-Cpp/include/common/wx/protocol" -I"C:/Programmi/Dev-Cpp/include/common/wx/stc" -I"C:/Programmi/Dev-Cpp/include/common/wx/svg" -I"C:/Programmi/Dev-Cpp/include/common/wx/xml" -I"C:/Programmi/Dev-Cpp/include/common/wx/xrc" -I"C:/Programmi/Dev-Cpp/include/common/wx" -I"C:/Programmi/Dev-Cpp/include/common" -I"C:/Programmi/Dev-Cpp/include"
RCINCS = --include-dir "C:/PROGRA~1/Dev-Cpp/include/common"
BIN = MingW/Progetto1.dll
DEFINES =
CXXFLAGS = $(CXXINCS) $(DEFINES) -DBUILDING_DLL=1
CFLAGS = $(INCS) $(DEFINES) -DBUILDING_DLL=1
GPROF = gprof.exe
RM = rm -f
LINK = g++.exe

.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after

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

STATICLIB = MingW/Progetto1.a

$(BIN): $(LINKOBJ)
$(LINK) --out-implib "lib$(STATICLIB)" -o $(BIN) $(LINKOBJ) $(LIBS)

MingW/dllmain.o: $(GLOBALDEPS) dllmain.cpp
$(CPP) -c dllmain.cpp -o MingW/dllmain.o $(CXXFLAGS)
BTW I have not changed the project options. All is like wxDev have created automatically.

Someone can help me? Any suggestion? :?:

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Thu Nov 02, 2006 4:30 pm

You're right. The makefile is being generated wrong. It shouldn't be pointing to Project1.a.

I'll see if we can't correct this over the weekend.

Thanks for the report.
-Tony
Everybody's got something to hide except for me and my monkey.

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Fri Nov 03, 2006 9:17 pm

Alocin,

I've got a possible fix for this. Would you be willing to test it (or anyone else that uses DLL generation for that matter is welcome to test)?

Thanks.
-Tony
Everybody's got something to hide except for me and my monkey.

Samuel G.
Earned a small fee
Earned a small fee
Posts: 14
Joined: Sun Oct 02, 2005 1:13 pm
Contact:

Hi!

Post by Samuel G. » Thu Nov 09, 2006 2:40 pm

I got exactly the same Problem. Wonder, why we two seem to be the only ones, who have it (OK, I erred.).

So, where is the Fix? I am willing to test it!

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Tue Nov 14, 2006 3:04 am

Fixed in CVS. Alpha available at http://joelsplace.sg/projects/wxdsgn/. Please look at the notes on the page.

aval57
Knows some wx things
Knows some wx things
Posts: 35
Joined: Thu Aug 25, 2005 5:38 am

Post by aval57 » Mon Apr 09, 2007 4:37 am

I'm getting the identical error using 6.10.2 stable. The import library isn't generated:

Code: Select all

Compiler: Default GCC compiler
Building Makefile: "C:\projects\test\Makefile.win"
Executing  make...
mingw32-make.exe -f "C:\projects\test\Makefile.win" all 
g++.exe -c dllmain.cpp -o MingW/dllmain.o -I"C:/Programs/wxDev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Programs/wxDev-Cpp/include/c++/3.4.2/backward" -I"C:/Programs/wxDev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Programs/wxDev-Cpp/include/c++/3.4.2" -I"C:/Programs/wxDev-Cpp/include" -I"C:/Programs/wxDev-Cpp/" -I"C:/Programs/wxDev-Cpp/include/common/wx/msw" -I"C:/Programs/wxDev-Cpp/include/common/wx/generic" -I"C:/Programs/wxDev-Cpp/include/common/wx/fl" -I"C:/Programs/wxDev-Cpp/include/common/wx/gizmos" -I"C:/Programs/wxDev-Cpp/include/common/wx/html" -I"C:/Programs/wxDev-Cpp/include/common/wx/mmedia" -I"C:/Programs/wxDev-Cpp/include/common/wx/net" -I"C:/Programs/wxDev-Cpp/include/common/wx/ogl" -I"C:/Programs/wxDev-Cpp/include/common/wx/plot" -I"C:/Programs/wxDev-Cpp/include/common/wx/protocol" -I"C:/Programs/wxDev-Cpp/include/common/wx/stc" -I"C:/Programs/wxDev-Cpp/include/common/wx/svg" -I"C:/Programs/wxDev-Cpp/include/common/wx/xml" -I"C:/Programs/wxDev-Cpp/include/common/wx/xrc" -I"C:/Programs/wxDev-Cpp/include/common/wx" -I"C:/Programs/wxDev-Cpp/include/common"  -DBUILDING_DLL=1   -fexpensive-optimizations -O3

g++.exe -shared  MingW/dllmain.o -L"C:/Programs/wxDev-Cpp/Lib" --no-export-all-symbols --add-stdcall-alias   --implib "MingW/libProject1.a" -o MingW/Project1.dll

g++.exe: MingW/libProject1.a: No such file or directory

mingw32-make.exe: *** [MingW/Project1.dll] Error 1

Execution terminated
makefile.win:

Code: Select all

# Project: Project1
# Compiler: Default GCC compiler
# Compiler Type: MingW 3
# Makefile created by wxDev-C++ 6.10.2 on 09/04/07 00:11

CPP       = g++.exe
CC        = gcc.exe
WINDRES   = windres.exe
OBJ       = MingW/dllmain.o
LINKOBJ   = MingW/dllmain.o
LIBS      = -L"C:/Programs/wxDev-Cpp/Lib" --no-export-all-symbols --add-stdcall-alias  
INCS      = -I"C:/Programs/wxDev-Cpp/Include"
CXXINCS   = -I"C:/Programs/wxDev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Programs/wxDev-Cpp/include/c++/3.4.2/backward" -I"C:/Programs/wxDev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Programs/wxDev-Cpp/include/c++/3.4.2" -I"C:/Programs/wxDev-Cpp/include" -I"C:/Programs/wxDev-Cpp/" -I"C:/Programs/wxDev-Cpp/include/common/wx/msw" -I"C:/Programs/wxDev-Cpp/include/common/wx/generic" -I"C:/Programs/wxDev-Cpp/include/common/wx/fl" -I"C:/Programs/wxDev-Cpp/include/common/wx/gizmos" -I"C:/Programs/wxDev-Cpp/include/common/wx/html" -I"C:/Programs/wxDev-Cpp/include/common/wx/mmedia" -I"C:/Programs/wxDev-Cpp/include/common/wx/net" -I"C:/Programs/wxDev-Cpp/include/common/wx/ogl" -I"C:/Programs/wxDev-Cpp/include/common/wx/plot" -I"C:/Programs/wxDev-Cpp/include/common/wx/protocol" -I"C:/Programs/wxDev-Cpp/include/common/wx/stc" -I"C:/Programs/wxDev-Cpp/include/common/wx/svg" -I"C:/Programs/wxDev-Cpp/include/common/wx/xml" -I"C:/Programs/wxDev-Cpp/include/common/wx/xrc" -I"C:/Programs/wxDev-Cpp/include/common/wx" -I"C:/Programs/wxDev-Cpp/include/common"
RCINCS    = --include-dir "C:/Programs/WXDEV-~1/include/common"
BIN       = MingW/Project1.dll
DEFINES   = 
CXXFLAGS  = $(CXXINCS) $(DEFINES) -DBUILDING_DLL=1   -fexpensive-optimizations -O3
CFLAGS    = $(INCS) $(DEFINES) -DBUILDING_DLL=1   -fexpensive-optimizations -O3
GPROF     = gprof.exe
RM        = rm -f
LINK      = g++.exe

.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after

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

$(BIN): $(OBJ)
	$(LINK) -shared $(STATICLIB) $(LINKOBJ) $(LIBS) --implib "MingW/libProject1.a" -o MingW/Project1.dll

MingW/dllmain.o: $(GLOBALDEPS) dllmain.cpp dll.h
	$(CPP) -c dllmain.cpp -o MingW/dllmain.o $(CXXFLAGS)
This was a test using an empty default dll template project, but an actual dll project that built successfully with 6.10.1 now fails in the same way. Strangely, I tried swapping devcpp.exe back to 6.10.1.152 but still get no import library.

Bahman

aval57
Knows some wx things
Knows some wx things
Posts: 35
Joined: Thu Aug 25, 2005 5:38 am

Post by aval57 » Tue Apr 10, 2007 3:34 pm

After looking at a successful code::blocks compile log and changlng wxDec-C++'s makefile.win as follows:

Code: Select all

STATICLIB= "MingW/libProject1.a" #explicit declaration just for the sake of clarity
...
$(BIN): $(OBJ)
	$(LINK) -shared $(LINKOBJ) $(LIBS) -Wl,--out-implib=$(STATICLIB) -o $(BIN)
I was able to get it to link on the command-line.

Bahman

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Tue Apr 10, 2007 5:06 pm

aval57 wrote:After looking at a successful code::blocks compile log and changlng wxDec-C++'s makefile.win as follows:

Code: Select all

STATICLIB= "MingW/libProject1.a" #explicit declaration just for the sake of clarity
...
$(BIN): $(OBJ)
	$(LINK) -shared $(LINKOBJ) $(LIBS) -Wl,--out-implib=$(STATICLIB) -o $(BIN)
Looking at the original makefile, I can't seem to find where/if $STATICLIB is defined. I wonder if the problem was solved by defining that variable or by chaning the --implib to --out-implib (or both)? Could you do a test to see?


Thanks.
-Tony
Everybody's got something to hide except for me and my monkey.

aval57
Knows some wx things
Knows some wx things
Posts: 35
Joined: Thu Aug 25, 2005 5:38 am

Post by aval57 » Tue Apr 10, 2007 6:15 pm

$STATICLIB wasn't ever defined originally, though the literal string was supplied so I doubt if that had anything to do with it.

It appears to have to do with the '=' in the import library option. Both "--implib=$(STATICLIB)" and "--out-implib=$(STATICLIB)" work, but not "--implib $(STATICLIB)" or "--out-implib $(STATICLIB)"

Bahman

Post Reply