0

I have a C++ project including foreign C++ code (CoolProp). This foreign code I have compiled as static library. Compiler is TDM-GCC Vers 5.1.0 with -m32 option. I invoke in my C++ code again using TDM-GCC Vers 5.1.0 with -m32 option. I was able to compile and run a small command line test program. The whole compiling sequence (Windoes command line prompt or MSYS 1.0):

  1. Package fluidflow

g++ -c -o build/fluidflow.o -LC:/CoolProp/5.1.2/CoolProp/build -I./include -IC:/CoolProp/5.1.2/CoolProp/include src/fluidflow.cpp -lCoolProp -m32 && ar rcs build/libfluidflow.a build/fluidflow.o

  1. Package formulae

g++ -c -o build/formulae.o -I./include src/formulae.cpp -lm -m32 && ar rcs build/libformulae.a build/formulae.o

  1. Package fancoil

g++ -c -o build/fancoil.o -I./include src/fancoil.cpp -lm -m32 && ar rcs build/libfancoil.a build/fancoil.o

  1. Package circuit

g++ -c -o build/circuit.o -L./build -LC:/CoolProp/5.1.2/CoolProp/build -I./include src/circuit.cpp -IC:/CoolProp/5.1.2/CoolProp/include -lm -lfancoil -lformulae -lfluidflow -lCoolProp -m32 && ar rcs build/libcircuit.a build/circuit.o

  1. Package cell

g++ -c -o build/cell.o -L./build -LC:/CoolProp/5.1.2/CoolProp/build -I./include src/cell.cpp -IC:/CoolProp/5.1.2/CoolProp/include -lm -lcircuit -lfancoil -lformulae -lfluidflow -lCoolProp -m32 && ar rcs build/libcell.a build/cell.o

  1. Test program, packages fluidflow & fancoil

g++ -o test/test_simple.exe -L./build -LC:/CoolProp/5.1.2/CoolProp/build -I./include test/test_simple.cpp -IC:/CoolProp/5.1.2/CoolProp/include -lm -lcell -lcircuit -lfancoil -lformulae -lfluidflow -lCoolProp -m32 && cd test && test_simple.exe

Next I tried to build a GUI program with wxWidgets, Vers 3.0. As far as I didn't invoke my libraries I could compile using msys by g++ fancoil_gui.cpp wx-config --cxxflags --libs -o fancoil_gui When I tried to invoke my libraries, for example libformulae.a/formulae.h I uses the -m32 option and compiling always ends up in an error like

c:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/1.0/local/lib/libwxregexu-3.0.a when searching for -lwxregexu-3.0

Operating system is 64 bit Windows 7

How can I do it without creating errors?

JanS
  • 2,065
  • 3
  • 27
  • 29
Robert
  • 97
  • 6

1 Answers1

2

Doesn't look like an error. You have a 64-bit library on the PATH, but you're asking the linker to find a 32-bit one. It's just telling you that it's ignoring the 64-bit one.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • The rest of the g++ messages inside msys were "collect2.exe: error: ld returned 1 exit status" - in fact an ld/collect error. And no executable has been built. One possible question: the libraries libwxregexu-3.0.a and other are obviously 64 bit inside msys. Are there 32 bit versions available? Or how else can I solve the problem described in my first post? – Robert Mar 15 '16 at 18:29
  • @Robert: Yes, you need 32-bit versions of all your libraries if you want to build a 32-bit application. – Lightness Races in Orbit Mar 15 '16 at 18:33