0

the issue is after formatting windows (7 ultimate x64) I have tried to compile with new installation of Dev C++ IDE using mingw32 that's all.. I wonder how typical is this and is it my fault ?

I have tried searching on this issue and not clear from very few results what could be the problem .

...\DevCpp\DevCPPDLLcpp.o DevCPPDLLcpp.cpp:(.text+0x1e): undefined reference to `_imp__CoTaskMemAlloc@4'

the code is here :

https://stackoverflow.com/a/33238812/1329184

EDIT: added makefile..

x86_64-w64-mingw32/lib32" -static-libgcc -m32
INCS     = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include"
CXXINCS  = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++"
BIN      = DevCPPDLL.dll
CXXFLAGS = $(CXXINCS) -m32 -DBUILDING_DLL=1
CFLAGS   = $(INCS) -m32 -DBUILDING_DLL=1
RM       = rm.exe -f
DEF      = libDevCPPDLL.def
STATIC   = libDevCPPDLL.a

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

all: all-before $(BIN) all-after

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

$(BIN): $(LINKOBJ)
    $(CPP) -shared $(LINKOBJ) -o $(BIN) $(LIBS) -Wl,--output-def,$(DEF),--out-implib,$(STATIC),--add-stdcall-alias
Community
  • 1
  • 1
LoneXcoder
  • 2,121
  • 6
  • 38
  • 76
  • 1
    This is not a compiler error, but a linker error. You're not linking Ole32 any more apparently – Voo Feb 27 '16 at 17:45
  • This looks like a linking failure. Make sure that you're linking with the right libraries. – Sam Varshavchik Feb 27 '16 at 17:45
  • 1
    As already mentioned by @Voo, you need ole32.lib to be linked. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms692727%28v=vs.85%29.aspx – rkosegi Feb 27 '16 at 17:48
  • @rkosegi I have no idea how to, going through my code from the compilation with windows or gcc I could see `#include ` + `#include ` – LoneXcoder Feb 27 '16 at 18:17
  • @rkosegi it's `unmanaged c++` rather msvc++, note that I am new so I couldn't know if and how you realize it or not – LoneXcoder Feb 27 '16 at 18:22
  • @LoneXcoder from given snippet, I don't see content of $(LIBS), could you try to add -lole32 to gcc's command line? – rkosegi Feb 27 '16 at 19:43
  • @rkosegi I have installed Intel `c++` restarting the whole intention of who to not deal with, stick to what I know works...(btw, it was the problem but only one that got me started to think I'm over it) – LoneXcoder Feb 28 '16 at 00:47

0 Answers0