Author Topic: in release mode clntsh not found.  (Read 421 times)

Offline Rahul

  • Single posting newcomer
  • *
  • Posts: 5
in release mode clntsh not found.
« on: April 03, 2018, 06:30:35 pm »
hi to all, I've centos 6.6 in VM having codeblocks. and oracle 11gr2 in server(second VM).
i made a programm based on OCCI  following code:-
Code: [Select]
#include <iostream>
#include <iomanip>
#include <oracle/11.2/client/occi.h>
using namespace std;
using namespace oracle::occi;

int main()
{
        //Create new environment
        Environment *env = Environment::createEnvironment(Environment::DEFAULT);
        Connection *conn = NULL;

        try {
                string user     = "scott";
                string passwd   = "tiger";

                cout << "conection initialised"<< endl;
                //Create new connection
                conn = env->createConnection(user, passwd,"ora11gr2");// host);//"ora11gr2");//, host);
                cout << "conected"<< endl;
        }
        catch(SQLException &e) {
                cout << e.getMessage();
        }

        try {
                Statement *stmt = conn->createStatement("SELECT * FROM emp");
                stmt->setPrefetchRowCount(32);
                ResultSet *rs = stmt->executeQuery();
                while(rs->next()) {
                      cout << setw(5) << rs->getInt(1) << " " << setw(8) << rs->getString(2) << " "// << endl;

                           << setw(6) << rs->getString(3) << " "<< setw(4) << rs->getInt(4) << " " //<< endl;
                           << setw(10) << rs->getString(5) << " " << setw(5) << rs->getFloat(6) << " "// << endl;

                           << setw(8) << rs->getFloat(7) << " "<< setw(4) << rs->getInt(8) <<  endl;
                }
        }
        catch(SQLException &e) {
            cout  << e.what();
        }
 return 0;
}
now problem is that when i compiled this project in DEBUG mode, it is executed well ( without error. ( also i added clntsh, nnz11, occi libraries). now when i build this project RELEASE mode follwoing error occured :-

Build: Release in oraconn (compiler: GNU GCC Compiler)
ld  cannot find -lclntsh
 Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s))

 how to find it please suggest me.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6252
    • My Best Post
Re: in release mode clntsh not found.
« Reply #1 on: April 03, 2018, 07:54:31 pm »
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

You failed to post a build log!

Edit: Post at least the failed build log; but, I suggest looking at and maybe posting the debug build log that worked, also.

Tim S.
« Last Edit: April 03, 2018, 08:10:38 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Rahul

  • Single posting newcomer
  • *
  • Posts: 5
Re: in release mode clntsh not found.
« Reply #2 on: April 04, 2018, 07:39:58 am »
build log  :-
-----------------------

Code: [Select]
-------------- Build: Release in oraconn (compiler: GNU GCC Compiler)---------------

g++  -o bin/Release/oraconn obj/Release/main.o  -s  -lclntsh -locci -lociei -lnnz11 -locci -lclntsh
/usr/bin/ld: cannot find -lclntsh
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7260
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: in release mode clntsh not found.
« Reply #3 on: April 04, 2018, 08:06:43 am »
Please also add a build log from working debug-build.

A shot in the dark, is it possible, that you have added a lionker searchpath in the debug-target, which is missing in the build-target ?

Offline Rahul

  • Single posting newcomer
  • *
  • Posts: 5
Re: in release mode clntsh not found.
« Reply #4 on: April 04, 2018, 09:12:23 am »
build log of debug build :-
--------------------------

------------- Build: Debug in oraconn (compiler: GNU GCC Compiler)---------------

Target is up to date.
Nothing to be done (all items are up-to-date).


-------------- Run: Debug in oraconn (compiler: GNU GCC Compiler)---------------

Code: [Select]
Checking for existence: /opt/projects/codeblocks/oraconn/bin/Debug/oraconn
Executing: xterm -T oraconn -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.:/opt/oracle/instantclient_11_2 /opt/projects/codeblocks/oraconn/bin/Debug/oraconn  (in /opt/projects/codeblocks/oraconn/.)
Process terminated with status 0 (0 minute(s), 5 second(s))


Online stahta01

  • Lives here!
  • ****
  • Posts: 6252
    • My Best Post
Re: in release mode clntsh not found.
« Reply #5 on: April 04, 2018, 11:25:02 am »
Please learn to use rebuild or clean followed by build; when requested to post build logs!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1879
Re: in release mode clntsh not found.
« Reply #6 on: April 05, 2018, 09:53:42 am »
Quote
Please learn to use rebuild or clean followed by build; when requested to post build logs!
stahta01 was talking about always use Build->Rebuild or Build->Clean and Build->Build if you post a log in the forum.
without this logs we can not help you...