This discussion is archived
1 Reply Latest reply: Mar 4, 2013 2:09 PM by user12019117 RSS

OCI with GCC on Windows

991581 Newbie
Currently Being Moderated
Hi Guys,

I have a question.
Is it possible to use OCI with g++ (GCC) 3.4.2 (mingw-special) on windows?

I have been trying to develop a simple app on Dev C++ Version 4.9.9.2, using OCI (instantclient-basic-nt-11.2.0.3.0 distribution) on windows. I am not able to compile the code, it keeps giving me "File Format not recognized" error.

Below is my make file,

# Project: OraTest
# Makefile created by Dev-C++ 4.9.9.2

CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
OBJ = testora.o ../libjson_7.6.1/libjson/_internal/Source/internalJSONNode.o ../libjson_7.6.1/libjson/_internal/Source/JSONNode.o ../libjson_7.6.1/libjson/_internal/Source/JSONWorker.o ../libjson_7.6.1/libjson/_internal/Source/JSONChildren.o ../libjson_7.6.1/libjson/_internal/Source/JSONWriter.o $(RES)
LINKOBJ = testora.o ../libjson_7.6.1/libjson/_internal/Source/internalJSONNode.o ../libjson_7.6.1/libjson/_internal/Source/JSONNode.o ../libjson_7.6.1/libjson/_internal/Source/JSONWorker.o ../libjson_7.6.1/libjson/_internal/Source/JSONChildren.o ../libjson_7.6.1/libjson/_internal/Source/JSONWriter.o $(RES)
LIBS = -L"C:/Dev-Cpp/lib" -L"C:/Documents and Settings/*******/Desktop/CPP/oci/lib" -L"O:/ora102wXP/oci/include" ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/oraocci11.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/ociw32.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/oraociei11.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/ocijdbc11.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/vc9/oraocci11.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/vc8/oraocci11.dll O:/ora102wXP/BIN/oci.dll O:/ora102wXP/BIN/oraocci10.dll O:/ora102wXP/oci/lib/bc/oci.lib
INCS = -I"C:/Dev-Cpp/include" -I"C:/Documents and Settings/*******/Desktop/CPP/instantclient-basic-nt-11.2.0.3.0/instantclient_11_2"
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"O:/ora102wXP/oci/include" -I"C:/Documents and Settings/*******/Desktop/CPP/libjson_7.6.1/libjson/_internal/Source" -I"C:/Documents and Settings/*******/Desktop/CPP/libjson_7.6.1/libjson" -I"C:/Documents and Settings/*******/Desktop/CPP/libjson_7.6.1/libjson/_internal/Source/JSONDefs" -I"C:/Documents and Settings/*******/Desktop/CPP/instantclient-basic-nt-11.2.0.3.0/instantclient_11_2"
BIN = OraTest.exe
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)
RM = rm -f

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

all: all-before OraTest.exe all-after


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

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

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

../libjson_7.6.1/libjson/_internal/Source/internalJSONNode.o: ../libjson_7.6.1/libjson/_internal/Source/internalJSONNode.cpp
     $(CPP) -c ../libjson_7.6.1/libjson/_internal/Source/internalJSONNode.cpp -o ../libjson_7.6.1/libjson/_internal/Source/internalJSONNode.o $(CXXFLAGS)

../libjson_7.6.1/libjson/_internal/Source/JSONNode.o: ../libjson_7.6.1/libjson/_internal/Source/JSONNode.cpp
     $(CPP) -c ../libjson_7.6.1/libjson/_internal/Source/JSONNode.cpp -o ../libjson_7.6.1/libjson/_internal/Source/JSONNode.o $(CXXFLAGS)

../libjson_7.6.1/libjson/_internal/Source/JSONWorker.o: ../libjson_7.6.1/libjson/_internal/Source/JSONWorker.cpp
     $(CPP) -c ../libjson_7.6.1/libjson/_internal/Source/JSONWorker.cpp -o ../libjson_7.6.1/libjson/_internal/Source/JSONWorker.o $(CXXFLAGS)

../libjson_7.6.1/libjson/_internal/Source/JSONChildren.o: ../libjson_7.6.1/libjson/_internal/Source/JSONChildren.cpp
     $(CPP) -c ../libjson_7.6.1/libjson/_internal/Source/JSONChildren.cpp -o ../libjson_7.6.1/libjson/_internal/Source/JSONChildren.o $(CXXFLAGS)

../libjson_7.6.1/libjson/_internal/Source/JSONWriter.o: ../libjson_7.6.1/libjson/_internal/Source/JSONWriter.cpp
     $(CPP) -c ../libjson_7.6.1/libjson/_internal/Source/JSONWriter.cpp -o ../libjson_7.6.1/libjson/_internal/Source/JSONWriter.o $(CXXFLAGS)


Compiler Logs,

Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\*******\Desktop\CPP\TestProject\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\*******\Desktop\CPP\TestProject\Makefile.win" all
g++.exe testora.o ../libjson_7.6.1/libjson/_internal/Source/internalJSONNode.o ../libjson_7.6.1/libjson/_internal/Source/JSONNode.o ../libjson_7.6.1/libjson/_internal/Source/JSONWorker.o ../libjson_7.6.1/libjson/_internal/Source/JSONChildren.o ../libjson_7.6.1/libjson/_internal/Source/JSONWriter.o -o "OraTest.exe" -L"C:/Dev-Cpp/lib" -L"C:/Documents and Settings/*******/Desktop/CPP/oci/lib" -L"O:/ora102wXP/oci/include" ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/oraocci11.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/ociw32.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/oraociei11.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/ocijdbc11.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/vc9/oraocci11.dll ../instantclient-basic-nt-11.2.0.3.0/instantclient_11_2/vc8/oraocci11.dll O:/ora102wXP/BIN/oci.dll O:/ora102wXP/BIN/oraocci10.dll O:/ora102wXP/oci/lib/bc/oci.lib

O:/ora102wXP/oci/lib/bc/oci.lib: file not recognized: File format not recognized
collect2: ld returned 1 exit status

make.exe: *** [OraTest.exe] Error 1

Execution terminated


Any help will be greatly appreciated ! :)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points