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 8156871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:05:23+00:00 2026-06-06T17:05:23+00:00

I have a project that compiles and runs on my system but when I

  • 0

I have a project that compiles and runs on my system but when I try to run it on server it is giving compile-time errors. Here are the portion of the Makefile I use to compile it on my system:

CC =  gcc
CFLAGS = -g -Wall
COMPLILEFLAGS = `mysql_config --include`
LINKERINFO = `mysql_config --cflags --libs`

exec: main.o
    $(CC) $(CFLAGS) -o exec main.o $(LINKERINFO)

main.o: main.c
    $(CC) $(CFLAGS) $(COMPLILEFLAGS) -c main.c

When I run the same file on the server I get the following error:

gcc -g -Wall -I/usr/include/mysql -c main.c
In file included from main.c:13:
/usr/include/mysql/my_global.h:688: error: redefinition of typedef ‘my_bool’
/usr/include/mysql/mysql.h:55: note: previous declaration of ‘my_bool’ was here
In file included from main.c:13:
/usr/include/mysql/my_global.h:699: error: redefinition of typedef ‘my_socket’
/usr/include/mysql/mysql.h:69: note: previous declaration of ‘my_socket’ was here
In file included from main.c:13:
/usr/include/mysql/my_global.h:1102: error: redefinition of typedef ‘my_ulonglong’
/usr/include/mysql/mysql.h:132: note: previous declaration of ‘my_ulonglong’ was here
In file included from main.c:14:
/usr/include/mysql/my_getopt.h:64: warning: ‘enum loglevel’ declared inside parameter list

The main.c file is:

#include <stdio.h>
#include <mysql.h>
#include <my_global.h>

int main (void)
{
    return 0;
}

Can anyone suggest a possible work around this problem. All I want is to increase the portability of this code. One option I can think of is to make the files compiler and linker are using within my source and use them for compiling and linking.

By the way I am using mysql-server version 5.5 and server has mysql-server version 5.3

  • 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-06-06T17:05:24+00:00Added an answer on June 6, 2026 at 5:05 pm

    Looking at MySQL’s documentation I found that old versions included a warning that stated that my_global.h should be included before mysql.h for compiling on Windows.

    Try reversing the order of the includes and see if that fixes the issue. If it does, a bug is to be filed with MySQL urgently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that compiles and runs fine on my development machine but
I have a C# project that compiles normally. When I run the project via
My project compiles and runs fine unless I try to compile my Unit Test
I have an Xcode 4.3.2 iOS 5.1 project that compiles and runs fine when
I have a game code (from ioquake3 project) that compiles part of gameplay binaries
I have a project that defines an idl and it compiles it using MIDL.
I have a DUnit project that won't compile as Console if I add some
I am making a project that should compile on Windows and Linux. I have
I have multimodule project. Can I make it somehow work that when calling compile
I have a project that is supposed to run on different (at least 2)

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.