Author Topic: How to add a linker library?  (Read 4597 times)

Offline asitis

  • Single posting newcomer
  • *
  • Posts: 5
How to add a linker library?
« on: August 19, 2009, 07:40:33 am »
Guys

I am trying to add a wxSqlite3 library so that the it can be found during linking. To add it, I use  Project->Build Options->Linker Settings then add the location where the library resides to the list. As the results, the compiling and linking process run smoothly but my project cannot be executed. I wonder if I have missed something while adding the library. Can someone help please.


My system
codeblocks build Apr 19 2009
wx2.8.9 (linux, unicode)
latest version of sqlite3 and wxsqlite3
Ubuntu 9.0.4

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: How to add a linker library?
« Reply #1 on: August 19, 2009, 08:32:33 am »
I wonder if I have missed something while adding the library.
If you use wxSQLite as library your dynamic application will need to find the shared object file. So you'll have to install wxSQLite on your system, too.

However - it would be more helpful if you tell us the error that actually happens. "Error" can be anything. Probably you are accessing a NULL pointer or alike so it's not even related to wxSQLite.

Notice: our question is hardly related to Code::Blocks so the topic might be locked.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline asitis

  • Single posting newcomer
  • *
  • Posts: 5
Re: How to add a linker library?
« Reply #2 on: August 24, 2009, 03:17:35 am »
I wonder if I have missed something while adding the library.
If you use wxSQLite as library your dynamic application will need to find the shared object file. So you'll have to install wxSQLite on your system, too.

However - it would be more helpful if you tell us the error that actually happens. "Error" can be anything. Probably you are accessing a NULL pointer or alike so it's not even related to wxSQLite.

Notice: our question is hardly related to Code::Blocks so the topic might be locked.

I guess many Code::Block users are using wxSQlite3 with Code::Blocks in Ubuntu environment and I am wondering if someone can show me how to link wxSQlite3 library in the Code::Block linker settings. My problem is I can't execute my program if I instantiate an object of type wxSQliteDatabase, I have installed wxSQlite3 in my system and i think I missed a step or two when setting up the linking wxSQlite3 library. Here is the build message produced by Code::Blocks

For building:

-------------- Build: Release in PC Timer ---------------

Precompiling header: wx_pch.h
Compiling: DBInterface.cpp
Compiling: PC_TimerApp.cpp
Compiling: PC_TimerMain.cpp
/home/user/Desktop/PC Timer/PC_TimerMain.cpp: In member function ‘void PC_TimerFrame::doAction(long int, long int, long int, long int)’:
/home/user/Desktop/PC Timer/PC_TimerMain.cpp:334: warning: unused variable ‘db’
Linking executable: bin/Release/PC Timer
Output size is 94.84 KB
Process terminated with status 0 (0 minutes, 23 seconds)
0 errors, 1 warnings

For executing:

Checking for existence: /home/user/Desktop/PC Timer/bin/Release/PC Timer
Executing: /home/user/Desktop/PC\ Timer/bin/Release/PC\ Timer (in /home/user/Desktop/PC Timer/.)
Process terminated with status 127 (0 minutes, 0 seconds)

It does not show any error message when compiling or linking but simply won't execute. Any help please