I have a problem when i try to compile a laTeX file from a C++ class. C++ backend works ok (not a problem there) but always failed to compile with this error "! LaTeX Error: File `colortbl.sty' not found."

I have copy the file colortbl.sty in ../tex/latex like other case that i have found on the internet but doesnt work. I have copy this file even in the some folder with xelatex.exe but didn't work. The .tex file works ok in TeXstudio (i don't have any errors).Can someone give me some ideea regarding this ?

Log file

This is XeTeX, Version 3.14159265-2.6-0.99998 (MiKTeX 2.9.6350) (preloaded format=xelatex ) 3 APR 2018 10:37 entering extended mode **C:/Users/User1/AppData/Local/Temp/test.tex (C:/Users/User1/AppData/Local/Temp/test.tex LaTeX2e <2017-04-15> Babel <3.10> and hyphenation patterns for 1 language(s) loaded. (E:\Latex\LatexLib\Lib\tex\latex\base\article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (E:\Latex\LatexLib\Lib\tex\latex\base\size10.clo File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) ) \c@part=\count79 \c@section=\count80 \c@subsection=\count81 \c@subsubsection=\count82 \c@paragraph=\count83 \c@subparagraph=\count84 \c@figure=\count85 \c@table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (E:\Latex\LatexLib\Lib\tex\latex\geometry\geometry.st y Package: geometry 2010/09/12 v5.6 Page Geometry (E:\Latex\LatexLib\Lib\tex\latex\graphics\keyval.sty Package: keyval 2014/10/28 v1.15 key=value parser (DPC) \KV@toks@=\toks14 ) (E:\Latex\LatexLib\Lib\tex\generic\oberdiek\ifpdf.sty Package: ifpdf 2017/03/15 v3.2 Provides the ifpdf switch ) (E:\Latex\LatexLib\Lib\tex\generic\oberdiek\ifvtex.st y Package: ifvtex 2016/05/16 v1.6 Detect VTeX and its facilities (HO) Package ifvtex Info: VTeX not detected. ) (E:\Latex\LatexLib\Lib\tex\generic\ifxetex\ifxetex.st y Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional ) \Gm@cnth=\count87 \Gm@cntv=\count88 \c@Gm@tempcnt=\count89 \Gm@bindingoffset=\dimen103 \Gm@wd@mp=\dimen104 \Gm@odd@mp=\dimen105 \Gm@even@mp=\dimen106 \Gm@layoutwidth=\dimen107 \Gm@layoutheight=\dimen108 \Gm@layouthoffset=\dimen109 \Gm@layoutvoffset=\dimen110 \Gm@dimlist=\toks15

(E:\Latex\LatexLib\Lib\tex\xelatex\xetexconfig\geometry .cfg)) (E:\Latex\LatexLib\Lib\tex\latex\base\inputenc.s ty Package: inputenc 2015/03/17 v1.2c Input encoding file \inpenc@prehook=\toks16 \inpenc@posthook=\toks17 ) (E:\Latex\LatexLib\Lib\tex\latex\xcolor\xcolor.sty Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)

(E:\Latex\LatexLib\Lib\tex\latex\graphics-cfg\color.cfg File: color.cfg 2016/01/02 v1.6 sample color configuration ) Package xcolor Info: Driver file: xetex.def on input line 225.

(E:\Latex\LatexLib\Lib\tex\latex\graphics-def\xetex.def File: xetex.def 2016/07/11 v4.10 LaTeX color/graphics driver for XeTeX (L3/RRM/ JK) ) Package xcolor Info: Model cmy' substituted bycmy0' on input line 1348. Package xcolor Info: Model RGB' extended on input line 1364. Package xcolor Info: ModelHTML' substituted by rgb' on input line 1366. Package xcolor Info: ModelHsb' substituted by hsb' on input line 1367. Package xcolor Info: ModeltHsb' substituted by hsb' on input line 1368. Package xcolor Info: ModelHSB' substituted by hsb' on input line 1369. Package xcolor Info: ModelGray' substituted by gray' on input line 1370. Package xcolor Info: Modelwave' substituted by `hsb' on input line 1371. )

! LaTeX Error: File `colortbl.sty' not found.

Type X to quit or to proceed, or enter new name. (Default extension: sty)

Enter file name: ^^@:8: Emergency stop *** (cannot \read from terminal in nonstop modes)

Here is how much of TeX's memory you used: 1380 strings out of 429739 17293 string characters out of 3180258 82458 words of memory out of 3000000 5272 multiletter control sequences out of 15000+200000 3648 words of font info for 15 fonts, out of 3000000 for 9000 14 hyphenation exceptions out of 8191 23i,0n,35p,265b,40s stack positions out of 5000i,500n,10000p,200000b,50000s No pages of output.

  • Ignoring TeXstudio for the moment, what happens if you open a command prompt and try to build the document manually? If that fails, then there's a TeXstudio-specific setting somewhere that lets you find the necessary packages. If that manual build succeeds, but the one from inside your C++ program still fails, then you may need to examine environment variables or other settings available to your command prompt that aren't standard system-wide settings. – Mike Renfro Apr 2 '18 at 14:48
  • 1
    your question isn't very clear but it sounds like you have two tex distributions on your system and when called from your c++ application the PATH may be different and it's using one without colortbl but it is hard to guess from the information given – David Carlisle Apr 2 '18 at 14:49
  • @DavidCarlisle I have a version of tex installed with interface and one just with the backend (portable). For both,I am using xelatex.If i try in command line then works, if I try from C++ with the some command the compiler creates a log file where it says that he can't find that file. – Adrian Apr 2 '18 at 15:10
  • 1
    So you have got two? compare the log files (or post them here) of a small example (actually an empty document thet just has \usepackage{colortbl} would do, it is not inpossible if your calling path via C++ has set the TEXINPUTS environment variable for example tex will look wherever that says, not in the standard place. You just need to updat eboth systems using tlmgr or the miktex equivalent colortbl to install colortbl. – David Carlisle Apr 2 '18 at 15:22
  • @DavidCarlisle I have completely remove colortbl and still got some error. I am using this color just for column color. Now i am using just xcolor\usepackage[table,xcdraw]{xcolor} – Adrian Apr 3 '18 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.