Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6805477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:35:28+00:00 2026-05-26T19:35:28+00:00

I’m trying to load an openGL texture for a game. The texture is an

  • 0

I’m trying to load an openGL texture for a game. The texture is an image that has been exported as a .C source file from GIMP. When I #include this file in my project (using Visual C++ 2010 Ultimate), I get a compiler error saying fatal error C1091: compiler limit: string exceeds 65535 bytes in length

Is there any workaround ?

The reason I wanted to export the image as a C header file was so that the program compiles with the image, and I dont have to provide raw image files along with the executable.

Code:

#include <iostream>
#include <Windows.h>
#include <glfw.h>
#include "X.c"

#define X 1
#define O 2

#pragma comment(lib, "glfw.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "gdi32.lib")

using namespace std;

float render();
void stepGame(float);
void keyboard(int, int);

int main(int argv, int *argc[])
{
    glfwInit();
    glfwOpenWindow(480, 480, 16, 16, 16, 16, 16, 16, GLFW_WINDOW);
    glfwSetKeyCallback(keyboard);
    glfwSetWindowTitle("Tic Tac Toe!");
    glClearColor(1.0, 1.0, 1.0, 1.0);
    float dT;

    while(glfwGetWindowParam(GLFW_OPENED) > 0)
    {
        glfwPollEvents();
        dT = render();
        stepGame(dT);
    }
    return 0;
}

Image file:
X.c

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:35:29+00:00Added an answer on May 26, 2026 at 7:35 pm

    Here is an alternative solution. Export the image as a raw data file, then use bin2hex to convert it to a C/C++ array. This will work fine because instead of a huge string this script generates a char array. Here is an example:

    $ bin2hex.pl
    bin2hex.pl by Chami.com
    
    usage:
      perl bin2hex.pl <binary file> <language id>
    
      <binary file> : path to the binary file
      <language id> : 0 = Perl, 1 = C/C++/Java, 2 = Pascal/Delphi
    
    $ bin2hex.pl x.bin 1
    
    /* begin binary data: */
    char bin_data[] = /* 112 */
    {0x23,0x69,0x6E,0x63,0x6C,0x75,0x64,0x65,0x20,0x3C,0x73,0x74,0x64,0x69,0x6F
    ,0x2E,0x68,0x3E,0x0A,0x23,0x69,0x6E,0x63,0x6C,0x75,0x64,0x65,0x20,0x3C,0x74
    ,0x69,0x6D,0x65,0x2E,0x68,0x3E,0x0A,0x0A,0x69,0x6E,0x74,0x20,0x6D,0x61,0x69
    ,0x6E,0x28,0x69,0x6E,0x74,0x20,0x61,0x72,0x67,0x63,0x2C,0x20,0x63,0x68,0x61
    ,0x72,0x2A,0x20,0x61,0x72,0x67,0x76,0x5B,0x5D,0x29,0x0A,0x7B,0x0A,0x20,0x20
    ,0x20,0x20,0x70,0x72,0x69,0x6E,0x74,0x66,0x28,0x22,0x25,0x64,0x5C,0x6E,0x22
    ,0x2C,0x20,0x73,0x69,0x7A,0x65,0x6F,0x66,0x28,0x74,0x69,0x6D,0x65,0x5F,0x74
    ,0x29,0x29,0x3B,0x0A,0x7D,0x0A,0x0A};
    /* end binary data. size = 112 bytes */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.