I am trying to create a shared library in linux fro a program which uses opencv and tesseract with dynamic linking
I followed link My code is as follows
g++ -c Serial_Key.cpp -fPIC -o cdserial `pkg-config --cflags --libs opencv` -llept -ltesseract g++ -shared -Wl,-soname,libctest.so.1 -o libctest.so.1.0 cdserial ln -sf libctest.so.1.0 libctest.so ln -sf libctest.so.1.0 libctest.so.1 g++ -c Test.cpp -fPIC -o cprog -lctest `pkg-config --cflags --libs opencv` -llept -ltesseract Here Test.cpp is a simple file as follows
#include <stdio.h> int Serial_key(); int main(){ int x=Serial_key(); printf("Success"); return 0;} somehow its giving error for ./cprog as ./cprog: cannot execute binary file: Exec format error
I feel that i am doing some fundamental mistake at 2nd line (g++ -shared) Please guide