Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6997447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:17:05+00:00 2026-05-27T20:17:05+00:00

The problem I am having is a little hard to explain, but I will

  • 0

The problem I am having is a little hard to explain, but I will try to put it in a simple way (I have no more ideas on how to solve it).

Well, basically, we have a very big C++ project on linux. This project was compiled with makefiles, but in the new version we are migrating it to CMake.
The CMake version is compiling fine, but the behavior when loading a library is a little different.

Here is the scenario: I have a folder with the following files:

/appserver/appserver_cmake (the binary compiled using cmake)
/appserver/appserver_original (the binary compiled using the makefiles)
/appserver/dbsrv.so (the library the program is trying to load)

There is a class called “tTOPClient”, which is compiled inside the executable and inside the library. The idea is: if the library exists, the program should execute the functions inside the library. Otherwise, it should execute its own function.

Here is the stack when executing the appserver_original:

    bAdvplConn=0 '\000') at ../fatclient/clientconn.cpp:260
#1  0xb6396fe2 in tTOPClient::m4GLConnect (this=0x2075d858, server=0x2075e3d4 "(local)", environment=0x2075e404 "ORACLE", 
    user=0x203c6731 "user") at ../fatclient/clientconn.cpp:255
#2  0xb63a0f1d in v40TC_m4GLConnect (who=0x2075d858, toServer=0x2075e3d4 "(local)", init_prm=0x2075e404 "@!!@ORACLE/ora10g_v1002t", usr=0x203c6731 "user")
    at ../fatclient/topapi40.cpp:63
#3  0x0866e49c in tTopDriver::APTC_Connect (this=0x2075e4d0, who=0x2075d858, toServer=0x2075e3d4 "(local)", conn_str=0x2075e404 "ORACLE", 
    usrname=0x203c6731 "user", nSeed=-1230926992) at ./lib/top.cpp:3718
#4  0x0866d0eb in tTopDriver::Connect (this=0x2075e4d0) at ./lib/top.cpp:3314

In summary, the sequence of calls:

tTopDriver::Connect (inside the executable)
tTopDriver::APTC_Connect (inside the executable, will call a library's function)
v40TC_m4GLConnect (inside the library)
tTOPClient::m4GLConnect (inside the library)

When I run the “appserver_cmake”, the “APTC_Connect” is calling the library’s “v40TC_m4GLConnect”, but this function is called the “tTOPClient::m4GLConnect” that is inside the executable, and not the one inside itself.

Here is the stack:

    bAdvplConn=0 '\000') at /home/user/adv/trunk/topconnect/4.0/client/clientconn.cpp:207
#1  0x08abe8d2 in tTOPClient::m4GLConnect (this=0x20a1d528, server=0x20a1d78c "(local)", environment=0x20a1ffcc "ORACLE", 
    user=0x20600c69 "user") at /home/user/adv/trunk/topconnect/4.0/client/clientconn.cpp:202
#2  0xae1a0f1d in v40TC_m4GLConnect (who=0x20a1d528, toServer=0x20a1d78c "(local)", init_prm=0x20a1ffcc "ORACLE", usr=0x20600c69 "user")
    at ../fatclient/topapi40.cpp:63
#3  0x08982730 in tTopDriver::APTC_Connect (this=0x209f0780, who=0x20a1d528, toServer=0x20a1d78c "(local)", conn_str=0x20a1ffcc "ORACLE", 
    usrname=0x20600c69 "user", nSeed=-1335784592) at /home/user/adv/trunk/lib/top.cpp:3718
#4  0x0898137f in tTopDriver::Connect (this=0x209f0780) at /home/user/adv/trunk/lib/top.cpp:3314

In summary:

tTopDriver::Connect (inside the executable)
tTopDriver::APTC_Connect (inside the executable, will call a library's function)
v40TC_m4GLConnect (inside the library)
tTOPClient::m4GLConnect (inside the executable!!!)

Do someone know what could be causing this different behavior? The makefiles and the CMakeLists are too big to post here, but I’ve compared them and they seem to be similar. I’ve tried to make a small example, but I couldn’t reproduce the problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:17:06+00:00Added an answer on May 27, 2026 at 8:17 pm

    I would also suspect different flags being passed to compiler or linker. I would compile everything, then touch only one cpp file and compile the cmake build like this:

    VERBOSE=1 make -j1 > log-cmake.txt

    The VERBOSE=1 leads to make showing the parameters which are passed to gcc. Then compile with your old makefile

    make -f Makefile.old > log-oldmakefile.txt

    When you find flags which are different between the two compiler / linker invocations look at these cmake variables:

    • CMAKE_CXX_FLAGS
    • CMAKE_CXX_FLAGS_RELEASE
    • CMAKE_SHARED_LINKER_FLAGS

    information about the meaning of the variables is in the cmake wiki

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m having a little Architecture problem. In my project I have a Business Logic
I'm having a little problem with nginx and the Perl FCGI module. I have
The problem that I am having is a little hard to describe, so please
I'm having a little problem with jQuery ajax and an animation. I have a
I'm having a little problem with this setup here I have a list of
As I'm a newbie to jQuery I'm having a little problem. I have two
I'm having a little problem displaying data from a database... I have two database
I'm having a little problem and I don't see why, it's easy to go
I'm having a little problem with the following: When I execute this line: echo
I'm having a little problem with jQuery: I'm having .submit() defined on a form,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.