Author Topic: wxSQLLite3 unresolved reference in new project, works fine in prev proj  (Read 3991 times)

Offline bemax56

  • Single posting newcomer
  • *
  • Posts: 3
I am new to Code::Blocks, wxWidgets and wxsqllite3 but have C++ experience mostly with C++ Builder from Borland, etc.

I got CB, wxWidgets installed with no problems and wxsqllite3 installed ok.

I created a small test project to learn how to use wxsqllite3 and compiled it and it ran great. :)  I got confident that I knew how to open databases, read data, update data, etc.

So I created another project in CB using the wxwidgets project template and added the headers for the wxsqllite3, wrote some code and tried to compile and link.  It compiles fine but gives a series of unresolved reference errors for the wxsqllite library functions and classes.

Since the first project compiled and linked ok, I think it must be I have left something out in the linker settings or something but the projects properties look identical. 

What am I missing?   ???

-- Thanks in advance,

Bemax

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
What am I missing?   ???
The wxWidgets wizards asks you for the "flavour" of your wxWidgets version, so is it monolithic, dynamic, static, Unicode and alike. That must match your "self-compiled" wxWidgets version, otherwise you get linker errors (the same would happen on the command line). If unsure, check the compiler flags, includes and #defines between both projects.
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 bemax56

  • Single posting newcomer
  • *
  • Posts: 3
Thank you for the quick response.  I will check that.

Bemax

Offline ouch

  • Almost regular
  • **
  • Posts: 223
I would just like to add that the developer for wxsqlite3 has stated that he never intended wxsqlite3 to be compiled and linked statically or dynamically. Your supposed to just add the files to your project and then link to the sqlite3 library file. And the sqlite3 library file should be statically linked.

Doing all this will deliver the best performance when working with your databases.

Offline bemax56

  • Single posting newcomer
  • *
  • Posts: 3
Thank you for the replies and the tips.  I found that I had pointed the global Build Options to the wxsqllite3 library but not the project build options.  Fixing that allows the files to compile and link. 

After your suggestion MortenMacFly, I may just add the headers and code to the project.

Another question?  I know I can add the sqllite3.dlll to the release directory but I don't want twenty copies around the disk in different project files.  Is there a way to point the linker/lib to an external dll for linking during builds?

I tried adding an external dependency in the project properties but it doesnt seem to do anything.

Thanks again,

Brian

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
Another question?  I know I can add the sqllite3.dlll to the release directory but I don't want twenty copies around the disk in different project files.  Is there a way to point the linker/lib to an external dll for linking during builds?
It has to be anywhere in a folder accessible in the PATH environment variable. So either you copy it to one of these folders or you use the EnvVar plugin to extend the PATH environment variable accordingly. Make sure you are extending, not to screw anything...
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