Coder Social home page Coder Social logo

Comments (3)

vrogier avatar vrogier commented on July 22, 2024

Hi,

Can you give more information?
OS and build tools versions?
Oracle version?
OCILIB version?
What are the link flags that you use?

Seems that error is a link issue on macos.

Vincent

from ocilib.

KambizAsadzadeh avatar KambizAsadzadeh commented on July 22, 2024

Hi,

Can you give more information? OS and build tools versions? Oracle version? OCILIB version? What are the link flags that you use?

Seems that error is a link issue on macos.

Vincent

Hi,
Yes, The error belongs to the macOS environment, you're right.

I have installed the latest version of oclib: v4.7.6

And I have configured it like this command:

./configure --with-oracle-lib-path="/opt/homebrew/Cellar/instantclient-sqlplus/19.8.0.0.0dbru/lib" --with-oracle-lib-path="/opt/homebrew/Cellar/instantclient-basic/19.8.0.0.0dbru/lib" --with-oracle-headers-path="/opt/homebrew/Cellar/instantclient-sdk/19.8.0.0.0dbru/include/"

My third-party/oclib/lib folder contains the following files:
libocilib.4.dylib | libocilib.a | libocilib.dylib (alias) | libocilib.la

  • instantclient-sqlplus 19.8.0.0.0dbru (installed by brew)
  • instantclient-basic 19.8.0.0.0dbru (installed by brew)
  • macOS 13.2.1
  • Architecture arm64 (M1)
  • CMake 3.24.2
  • Compiler (GCC12.x | Clang 16.x)
cmake_minimum_required(VERSION 3.5)

project(OracleTest LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third-party/oclib/include)

add_executable(OracleTest main.cpp)

target_link_libraries(OracleTest "-L/${CMAKE_CURRENT_SOURCE_DIR}/third-party/oclib/lib -locilib")

install(TARGETS OracleTest
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

main.cpp example:

#include <iostream>

#include <ocilib.hpp>

using namespace ocilib;

int main()
{
    try
    {
        Environment::Initialize();

        Connection con("db", "usr", "pwd");

        Statement st(con);
        st.Execute("select * from products");

        Resultset rs = st.GetResultset();
        while (rs++)
        {
            std::cout << "code:" << rs.Get<ostring>(1) << " name:" << rs.Get<ostring>(2) << std::endl;
        }

        std::cout << "=> Total fetched rows : " << rs.GetCount() << std::endl;

    }
    catch (std::exception &ex)
    {
        std::cout << "Error:" << ex.what() << std::endl;
    }

    Environment::Cleanup();

    return EXIT_SUCCESS;
}

I think it is a problem due to lack of support for this (arm64 M1) architecture.

from ocilib.

vrogier avatar vrogier commented on July 22, 2024

Closing issue as it is not an OCILIB issue.

from ocilib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.