Adding search path

General questions regarding the usage of CodeLite
evstevemd
CodeLite Guru
Posts: 352
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Adding search path

Post by evstevemd »

Hi,
I have made a project that Uses sqlite3.h. the file works fine in its project folder (sqlite3) but when I try to include the same file in another project (wxsqlite3) Compiler cannot find it. I have tried to add different paths to search path but I cannot find a way out (../sdk/sqlite3, ../../sdk/sqlite3, ./sdk/sqlite3, $(WorkspacePath)/sdk/sqlite3 and anything I can think of)
Can one please help me!
You do not have the required permissions to view the files attached to this post.

CodeLite 15.x
CodeLite is awesome, I just Love it!

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by eranif »

When codelite compiles a project, it changes the directory to the project directory (i.e. the directory where the .project exists).
So in your case, when codelite will start building wxsqlite3, it will set its directory to the wxsqlite3 directory.
So you should add include path:

Code: Select all

../sqlite3
Some hints: in the build windows, before codelite builds a project, it will write in grey the lines:
"Entering directory /some/path"
this should give you a hint where is the current working directory is.

Eran
Make sure you have read the HOW TO POST thread
evstevemd
CodeLite Guru
Posts: 352
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by evstevemd »

Hi Eran,

I still get the error
My Compiler additional search path is
.;../../sdk/sqlite3;../sqlite3

Code: Select all

----------Build Started--------
C:\WINDOWS\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "myproject_wsp.mk""
----------Building project:[ wxqslite3 - DebugUnicode ]----------
mingw32-make.exe[1]: Entering directory `C:/Documents and Settings/stefano/Desktop/myproject/sdk/wxqslite3'
C:/Documents and Settings/stefano/Desktop/myproject/sdk/wxqslite3/wxsqlite3.cpp:46:21: error: sqlite3.h: No such file or directory
mingw32-make.exe[1]: *** [../../sdk/work/wxsqlite3/wxsqlite3.o.d] Error 1
mingw32-make.exe[1]: Leaving directory `C:/Documents and Settings/stefano/Desktop/myproject/sdk/wxqslite3'
mingw32-make.exe: *** [All] Error 2
----------Build Ended----------
1 errors, 0 warnings

CodeLite 15.x
CodeLite is awesome, I just Love it!

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by eranif »

Try build with -j2 (it seems like some of the output is missing, so it is hard to tell what the error is)

Settings -> Build Settings -> Build System and reduce the 'No. of concurrent jobs' to 1

Post here the output again

Eran
Make sure you have read the HOW TO POST thread
evstevemd
CodeLite Guru
Posts: 352
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by evstevemd »

Note, the -J2 option is unrecognized (Added to Compiler options)

----------Build Started--------
C:\WINDOWS\system32\cmd.exe /c ""mingw32-make.exe" -j 1 -f "MyProject_wsp.mk""
----------Building project:[ wxqslite3 - DebugUnicode ]----------
mingw32-make.exe[1]: Entering directory `C:/Documents and Settings/stefano/Desktop/MyProject/sdk/wxqslite3'
C:/Documents and Settings/stefano/Desktop/MyProject/sdk/wxqslite3/wxsqlite3.cpp:46:21: error: sqlite3.h: No such file or directory
g++: unrecognized option '-j2'
mingw32-make.exe[1]: *** [../../sdk/work/wxsqlite3/wxsqlite3.o.d] Error 1
mingw32-make.exe[1]: Leaving directory `C:/Documents and Settings/stefano/Desktop/MyProject/sdk/wxqslite3'
mingw32-make.exe: *** [All] Error 2
----------Build Ended----------
1 errors, 0 warnings

CodeLite 15.x
CodeLite is awesome, I just Love it!

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by eranif »

Can you send over the project zipped (attach it to this thread)?

Eran
Make sure you have read the HOW TO POST thread
evstevemd
CodeLite Guru
Posts: 352
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by evstevemd »

Here it is!
You do not have the required permissions to view the files attached to this post.

CodeLite 15.x
CodeLite is awesome, I just Love it!

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by eranif »

remove the -j2 flag that you added in 'Compiler Options' (-j2 is *not* a compiler option), also, if you wish to add options, you need to add them with semi colon separating between the different options.

Try to re-build and paste the output here
Eran
Make sure you have read the HOW TO POST thread
evstevemd
CodeLite Guru
Posts: 352
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by evstevemd »

Still it cannot build :oops:

Code: Select all

----------Build Started--------
C:\WINDOWS\system32\cmd.exe /c ""mingw32-make.exe"  -j 1 -f "MyProject_wsp.mk""
----------Building project:[ wxqslite3 - DebugUnicode ]----------
mingw32-make.exe[1]: Entering directory `C:/Documents and Settings/stefano/Desktop/MyProject/sdk/wxqslite3'
C:/Documents and Settings/stefano/Desktop/MyProject/sdk/wxqslite3/wxsqlite3.cpp:46:21: error: sqlite3.h: No such file or directory
mingw32-make.exe[1]: *** [../../sdk/work/wxsqlite3/wxsqlite3.o.d] Error 1
mingw32-make.exe[1]: Leaving directory `C:/Documents and Settings/stefano/Desktop/MyProject/sdk/wxqslite3'
mingw32-make.exe: *** [All] Error 2
----------Build Ended----------
1 errors, 0 warnings, total time: 00:00:11 seconds

CodeLite 15.x
CodeLite is awesome, I just Love it!

User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Adding search path

Post by eranif »

Ok, I still cant see the compilation line...

You will need to build it from command line:

1) Open the file wxsqlite3.cpp inside codelite
2) Right click on the file name (in the tab) and seelct 'Open Shell at File Path'
3) Inside the cmd.exe, navigate to the .workspace directory
4) type the command:

Code: Select all

C:\WINDOWS\system32\cmd.exe /c ""mingw32-make.exe"  -j 1 -f "MyProject_wsp.mk""
Paste the output here

Eran
Make sure you have read the HOW TO POST thread
Post Reply