Skip to content

Commit 94c3038

Browse files
committed
address clang issue
1 parent 285ecb0 commit 94c3038

File tree

4 files changed

+6
-44
lines changed

4 files changed

+6
-44
lines changed

src/Makevars.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PKG_CPPFLAGS=@cflags@
22

3-
# Force shared library linking by explicitly changing .a to .so
4-
PKG_LIBS=$(subst .a,.so,@libs@)
3+
# Link against Tesseract and Leptonica libraries
4+
PKG_LIBS=@libs@
55

66
# Set C++11 standard for compatibility
77
CXX_STD=CXX11

src/cpp11tesseract.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ tesseract::TessBaseAPI *get_engine(TessPtr engine) {
124124
writable::logicals out(params.size());
125125
STRING str;
126126
for (int i = 0; i < params.size(); i++) {
127-
#if defined(TESSERACT_HAS_GETVARIABLEASSTRING)
128-
// Use the newer API
127+
#if defined(TESSERACT_HAS_GETVARIABLEASSTRING) && !defined(__clang__)
128+
// Use the newer API - but avoid with clang due to linking issues
129129
out[i] = api->GetVariableAsString(std::string(params.at(i)).c_str(), &str);
130130
#else
131131
const char *value =
@@ -176,8 +176,8 @@ tesseract::TessBaseAPI *get_engine(TessPtr engine) {
176176
std::vector<std::string> values;
177177
for (int i = 0; i < params.size(); ++i) {
178178
STRING str;
179-
#if defined(TESSERACT_HAS_GETVARIABLEASSTRING)
180-
// Use the newer API
179+
#if defined(TESSERACT_HAS_GETVARIABLEASSTRING) && !defined(__clang__)
180+
// Use the newer API - but avoid with clang due to linking issues
181181
if (api->GetVariableAsString(std::string(params.at(i)).c_str(), &str)) {
182182
values.push_back(str);
183183
#else

src/cpp11tesseract_types.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Windows-specific symbol fixes
2-
#include "win_symbol_fixes.h"
3-
41
// Try multiple include paths for better cross-platform compatibility
52
#if __APPLE__
63
// On macOS, try multiple include paths

src/win_symbol_fixes.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)