News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

in release mode clntsh not found.

Started by Rahul, April 03, 2018, 06:30:35 PM

Previous topic - Next topic

Rahul

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:-

#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.

stahta01

#1
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Rahul

build log  :-
-----------------------


-------------- 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))


Jenna

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 ?

Rahul

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)---------------

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))


stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

BlueHazzard

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...