Author Topic: C::B cannot find include file  (Read 7473 times)

Offline grecd

  • Single posting newcomer
  • *
  • Posts: 5
C::B cannot find include file
« on: May 07, 2014, 09:55:49 am »
I have added existing file to directory of my project and added it to project.
When I try to compile it says no such file or directory;
By the way when i try to "find implementation" by clicking on method in any header file  it says "Not Found"
release 13.12 rev 9501

Offline Vuki

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: C::B cannot find include file
« Reply #1 on: May 07, 2014, 01:21:41 pm »
If you want to get help, you should post the full compiler log and relevant parts of your source code. We are not able to guess what is on your computer screen.

Offline grecd

  • Single posting newcomer
  • *
  • Posts: 5
Re: C::B cannot find include file
« Reply #2 on: May 07, 2014, 03:04:22 pm »

IPcameraRTSP.h
Code
#include <GL/gl.h>
#include "texture.h"
#include "MotionFrameDCT.h"
#include "Bmp2jpg.h"


Bmp2jpg.h
Code
#pragma once

typedef signed char         INT8, *PINT8;
typedef signed short        INT16, *PINT16;
typedef signed int          INT32, *PINT32;
//typedef signed __int64      INT64, *PINT64;
typedef unsigned char       UINT8, *PUINT8;
typedef unsigned short      UINT16, *PUINT16;
typedef unsigned int        UINT32, *PUINT32;
//typedef unsigned __int64    UINT64, *PUINT64;

typedef unsigned long ULONG;
typedef unsigned  char* PUCHAR;
typedef unsigned  char UCHAR;
//typedef signed __int64 int64_t;
//typedef unsigned __int64  u_int64_t;

#define NULL 0

#define DCTSIZE 8
#define DCTSIZE2 64
#define MAXJSAMPLE 255
#define CENTERJSAMPLE 128

#define JSAMPLE unsigned char

#define SCALEBITS 16
#define ONE_HALF ((long) 1 << (SCALEBITS-1))
#define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS)
#define FIX(x) ((long) ((x) * (1L<<SCALEBITS) + 0.5))

#define R_Y_OFF 0 /* offset to R => Y section */
#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */
#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */
#define R_CB_OFF (3*(MAXJSAMPLE+1))
#define G_CB_OFF (4*(MAXJSAMPLE+1))
#define B_CB_OFF (5*(MAXJSAMPLE+1))
#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */
#define G_CR_OFF (6*(MAXJSAMPLE+1))
#define B_CR_OFF (7*(MAXJSAMPLE+1))
#define TABLE_SIZE (8*(MAXJSAMPLE+1))

typedef short DCTELEM;

#define FIX_0_382683433  ((INT32)   98) /* FIX(0.382683433) */
#define FIX_0_541196100  ((INT32)  139) /* FIX(0.541196100) */
#define FIX_0_707106781  ((INT32)  181) /* FIX(0.707106781) */
#define FIX_1_306562965  ((INT32)  334)

#define ONE ((INT32) 1)

#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)
#define DESCALE_IDCT(x,n)  RIGHT_SHIFT(x, n)
#define CONST_BITS_FDCT  8
#define MULTIPLY_F(var,const)  ((DCTELEM) DESCALE_IDCT((var) * (const), CONST_BITS_FDCT))
#define MULTIPLY16V16(var1,var2)  ((var1) * (var2))

struct quantval
{
UINT16 quantval_luminance[DCTSIZE2];
UINT16 quantval_chrominance[DCTSIZE2];

UINT16 quantval_luminance2[DCTSIZE2];
UINT16 quantval_chrominance2[DCTSIZE2];
UINT16 quantval_luminance2m[DCTSIZE2];
UINT16 quantval_chrominance2m[DCTSIZE2];
UINT16 quantval_luminance2mz[DCTSIZE2];
UINT16 quantval_chrominance2mz[DCTSIZE2];

UINT16 iquantval_luminance2[DCTSIZE2];
UINT16 iquantval_chrominance2[DCTSIZE2];
};

class CBmp2jpg
{
public:
    CBmp2jpg(void);
    ~CBmp2jpg(void);
    int compress_24bmp2jpg(unsigned char* pbmp, int width, int height, unsigned char* pbuffer, int buffer_size);
    int compress_32bmp2jpg(unsigned char* pbmp, int width, int height, unsigned char* pbuffer, int buffer_size);
    void init_quantization(int quality);

    void rgb_ycc_convertor_init();
    void get_dct_blocks_color24(unsigned char* pPixelInBitmap, int BmpStride, short* pYDctBlock, short* pCbDctBlock, short* pCrDctBlock);
    void get_dct_blocks_color32(unsigned char* pPixelInBitmap, int BmpStride, short* pYDctBlock, short* pCbDctBlock, short* pCrDctBlock);
    void jpeg_fdct_ifast (DCTELEM * data);
    ULONG emit_bits(ULONG code, ULONG size, PUCHAR pOutputBuffer, ULONG BitIndex);
    ULONG emit_bits_2(ULONG code, ULONG size, PUCHAR pOutputBuffer, ULONG BitIndex);
    int encode_block(short *pBlock8x8, PUCHAR pDst, short* punused, int bit_idx, int last_dc, const unsigned int* phtable);
    void quantization(DCTELEM *workspace, UINT16 *divisors);
    void descale_iqunt (UINT16 *quantval, UINT16 *ifmtbl);
    void descale_qunt( UINT16 *quantval, UINT16 *dtbl);
    void jpeg_set_linear_quality (quantval* stQuantval, int scale_factor, bool force_baseline);
    int jpeg_quality_scaling (int quality);
    void jpeg_set_quality (quantval* stQuantval, int quality, bool force_baseline);
    void jpeg_add_quant_table (UINT16 *quantval, int which_tbl,
      const unsigned int *basic_table,
      int scale_factor, bool force_baseline);
    void prepare_range_limit_table();

    static bool m_rgb_ycc_tab_initialized;
    static long m_rgb_ycc_tab[TABLE_SIZE];
    static const unsigned int huf_tbl_Y[256*4];
    static const unsigned int huf_tbl_CbCr[256*4];
    static const unsigned int masktbl[9];
    static const unsigned int zigzag_order[64];
    JSAMPLE range_limit_table_data[(5 * (MAXJSAMPLE+1) + CENTERJSAMPLE)];
    JSAMPLE* range_limit_table;

    quantval m_quantval;
};

extern CBmp2jpg* G_pbmp2jpg;
extern unsigned char G_jpghdr[];






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

g++ -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -Wall -g -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -Iinclude -I/usr/include -I/home/user/projects/sglplayer/ -I/usr/include/ImageMagick -I../../ffmpeg-git/ffmpeg -c /home/user/projects/COPY2/sglplayer/Basicglplane.cpp -o obj/Debug/Basicglplane.o
In file included from /home/user/projects/COPY2/sglplayer/Basicglplane.h:24:0,
                 from /home/user/projects/COPY2/sglplayer/Basicglplane.cpp:1:
include/IPcameraRTSP.h:22:21: fatal error: Bmp2jpg.h: Нет такого файла или каталога
 #include "Bmp2jpg.h"
                     ^
compilation terminated.
Process terminated with status 1 (0 minute(s), 1 second(s))
1 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 



Offline stahta01

  • Lives here!
  • ****
  • Posts: 7787
    • My Best Post
Re: C::B cannot find include file
« Reply #3 on: May 07, 2014, 03:15:10 pm »
Read http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F

It is safer and better to use the "For your project" section of the directions.

NOTE: The file layout relative to the cb project file (cbp) is also needed to help with this type of question.

Tim S.
« Last Edit: May 07, 2014, 03:37:26 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Vuki

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: C::B cannot find include file
« Reply #4 on: May 07, 2014, 05:22:31 pm »
Your file "IPCameraRTSP.h" is in "sglplayer/include" directory and it tries to include "Bmp2Jpg.h" file which is not in the same directory. Add correct file location to compiler search path in CB. If the file is one level up, try adding parent directory (..). Anyway, the problem is in your project layout - make sure that each include can be found.

Offline grecd

  • Single posting newcomer
  • *
  • Posts: 5
Re: C::B cannot find include file
« Reply #5 on: May 07, 2014, 06:07:34 pm »
layout

Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
<File name="texture.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
<Cursor>
<Cursor1 position="2751" topLine="82" />
</Cursor>
</File>
<File name="sglplayerMain.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="5" zoom_2="0">
<Cursor>
<Cursor1 position="667" topLine="19" />
</Cursor>
</File>
<File name="Basicglplane.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="3" zoom_2="0">
<Cursor>
<Cursor1 position="914" topLine="36" />
</Cursor>
</File>
<File name="src/MotionFrame.cpp" open="0" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
<Cursor>
<Cursor1 position="88" topLine="0" />
</Cursor>
</File>
<File name="global.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="803" topLine="3" />
</Cursor>
</File>
<File name="Bmp2jpg.cpp" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="21399" topLine="120" />
</Cursor>
<Folding>
<Collapse line="7" />
<Collapse line="143" />
<Collapse line="377" />
<Collapse line="459" />
<Collapse line="562" />
<Collapse line="632" />
<Collapse line="741" />
</Folding>
</File>
<File name="Bmp2jpg.h" open="1" top="1" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2432" topLine="0" />
</Cursor>
</File>
<File name="texture.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="809" topLine="1" />
</Cursor>
</File>
<File name="sglplayerMain.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="3" zoom_2="0">
<Cursor>
<Cursor1 position="4386" topLine="119" />
</Cursor>
<Folding>
<Collapse line="145" />
<Collapse line="162" />
</Folding>
</File>
<File name="Basicglplane.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="4" zoom_2="0">
<Cursor>
<Cursor1 position="2646" topLine="32" />
</Cursor>
<Folding>
<Collapse line="21" />
<Collapse line="105" />
<Collapse line="128" />
<Collapse line="270" />
<Collapse line="382" />
</Folding>
</File>
<File name="src/RenderTimer.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="262" topLine="0" />
</Cursor>
</File>
<File name="SettingsDialog.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="3" zoom_2="0">
<Cursor>
<Cursor1 position="2226" topLine="0" />
</Cursor>
</File>
<File name="src/MotionFrameDCT.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="609" topLine="3" />
</Cursor>
</File>
<File name="include/IPcameraRTSP.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="442" topLine="5" />
</Cursor>
</File>
<File name="SettingsDialog.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="3" zoom_2="0">
<Cursor>
<Cursor1 position="138" topLine="0" />
</Cursor>
</File>
<File name="src/IPcameraRTSP.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="15327" topLine="334" />
</Cursor>
<Folding>
<Collapse line="249" />
</Folding>
</File>
<File name="sglplayerApp.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="320" topLine="0" />
</Cursor>
</File>
<File name="include/RenderTimer.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="63" topLine="0" />
</Cursor>
</File>
<File name="sglplayerApp.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="435" topLine="0" />
</Cursor>
</File>
<File name="include/MotionFrame.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="373" topLine="8" />
</Cursor>
</File>
</CodeBlocks_layout_file>

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7787
    • My Best Post
Re: C::B cannot find include file
« Reply #6 on: May 07, 2014, 06:18:38 pm »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Vuki

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: C::B cannot find include file
« Reply #7 on: May 07, 2014, 07:49:18 pm »
Now look at the layout you posted, look at your compiler search paths, re-read my previous post and think why the compiler is not able to find the included file. It's really a basic programming thing.
I've already told you how to solve this: add .. to compiler search path.