Author Topic: What wrong with my cbp file?  (Read 2645 times)

Offline xinlnix

  • Single posting newcomer
  • *
  • Posts: 9
What wrong with my cbp file?
« on: March 03, 2006, 11:03:50 pm »
I want compile wxWidgets 2.6.2 samples, I select "access"  sample, and I add accesstest.cpp,accesstest.rc,mondrian.ico,mondrian.xpm to the access.cbp, the Code::Blocks auto generate wx_pch.h file, now access.cbp like follow:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="3" />
   <Project>
      <Option title="access" />
      <Option pch_mode="0" />
      <Option compiler="gcc" />
      <Build>
         <Target title="default">
            <Option output="wxwidgets.exe" />
            <Option type="0" />
            <Option compiler="gcc" />
            <Option includeInTargetAll="1" />
            <Option projectResourceIncludeDirsRelation="0" />
            <Linker>
               <Add library="libwxmsw26u_adv" />
               <Add library="libwxmsw26u_core" />
               <Add library="libwxmsw26u_html" />
               <Add library="libwxmsw26u_media" />
               <Add library="libwxmsw26u_xrc" />
               <Add library="libwxbase26u" />
               <Add library="libwxbase26u_net" />
               <Add library="libwxbase26u_xml" />
               <Add library="libwxzlib" />
               <Add library="libwxexpat" />
               <Add library="libwxjpeg" />
               <Add library="libwxpng" />
               <Add library="libwxregexu" />
               <Add library="libwxtiff" />
            </Linker>
         </Target>
         <Environment>
            <Variable name="WX_CFG" value="" />
         </Environment>
      </Build>
      <Compiler>
         <Add option="-pipe" />
         <Add option="-mthreads" />
         <Add option="-Winvalid-pch" />
         <Add option='-include &quot;wx_pch.h&quot;' />
         <Add option="-D__GNUWIN32__" />
         <Add option="-D__WXMSW__" />
         <Add option="-DWXUSINGDLL" />
         <Add option="-DwxUSE_UNICODE" />
         <Add option="-DUSE_PCH" />
         <Add directory="$(#WX.include)" />
         <Add directory="$(#WX.lib)\gcc_dll$(WX_CFG)\mswu" />
         <Add directory="$(#WX)\contrib\include" />
      </Compiler>
      <ResourceCompiler>
         <Add directory="$(#WX.include)" />
      </ResourceCompiler>
      <Linker>
         <Add library="libwxmsw26u_adv" />
         <Add library="libwxmsw26u_core" />
         <Add library="libwxmsw26u_html" />
         <Add library="libwxmsw26u_media" />
         <Add library="libwxmsw26u_xrc" />
         <Add library="libwxbase26u" />
         <Add library="libwxbase26u_net" />
         <Add library="libwxbase26u_xml" />
         <Add library="libwxzlib" />
         <Add library="libwxexpat" />
         <Add library="libwxjpeg" />
         <Add library="libwxpng" />
         <Add library="libwxregexu" />
         <Add library="libwxtiff" />
         <Add directory="$(#WX.lib)\gcc_dll$(WX_CFG)" />
         <Add directory="$(#WX.lib)" />
      </Linker>
      <Unit filename="accesstest.cpp">
         <Option compilerVar="CPP" />
         <Option target="default" />
      </Unit>
      <Unit filename="accesstest.rc">
         <Option compilerVar="WINDRES" />
         <Option objectName="accesstest.res" />
         <Option target="default" />
      </Unit>
      <Unit filename="mondrian.ico">
         <Option compilerVar="CPP" />
         <Option compile="0" />
         <Option link="0" />
         <Option target="default" />
      </Unit>
      <Unit filename="mondrian.xpm">
         <Option compilerVar="CPP" />
         <Option compile="0" />
         <Option link="0" />
         <Option target="default" />
      </Unit>
      <Unit filename="wx_pch.h">
         <Option compilerVar="CPP" />
         <Option link="0" />
         <Option weight="0" />
         <Option target="default" />
      </Unit>
   </Project>
</CodeBlocks_project_file>

I think everything is good ,but when I compile , cb shows error:
------------- Build: default in access ---------------
Linking executable: wxwidgets_u.exe
D:\cplus\MinGW\lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `[email protected]'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
I have no main.c, why the compiler want it?  Please help me, thanks.

Offline xinlnix

  • Single posting newcomer
  • *
  • Posts: 9
Re: What wrong with my cbp file?
« Reply #1 on: March 03, 2006, 11:08:12 pm »
Correct a mistake: <Option output="wxwidgets_u.exe" /> at 10 line of project file

sethjackson

  • Guest
Re: What wrong with my cbp file?
« Reply #2 on: March 03, 2006, 11:10:20 pm »
Here is the problem

<Add option="-DWXUSINGDLL" />

You aren't using a dll build remove the above option from compiler #define's and you should be set. :D

Offline xinlnix

  • Single posting newcomer
  • *
  • Posts: 9
Re: What wrong with my cbp file?
« Reply #3 on: March 03, 2006, 11:43:38 pm »
I'm try ,but not it doesnot work yet.